Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I would just create two new tables <code>ItemProcurement</code> and <code>Currencies</code>.</p> <p>If I'm not wrong, as per the data presented, the amount is part of the procurement of the item itself (when the item has not been inherited), for that reason I would group the <code>Amount</code> and <code>CurrencyID</code> fields in the new entity <code>ItemProcurement</code>.</p> <p>As you can see, an inherited item wouldn't have an entry in the <code>ItemProcurement</code> table.</p> <p>Concerning the main <code>Item</code> table, if you expect just two different values for the kind of procurement, then I would use a <code>char(1)</code> column (varying from <code>B</code> => bougth, <code>I</code> => inherited).</p> <p>I would looks like this:</p> <p><img src="https://i.stack.imgur.com/LPiyY.png" alt="enter image description here"></p> <p>The data would then look like this:</p> <pre><code>TABLE Items +-------+-------+--------------------+ | ID | Mass | ProcurementMethod | |-------+-------+--------------------+ | 0 | 2 | I | +-------+-------+--------------------+ | 1 | 13 | B | +-------+-------+--------------------+ | 2 | 5 | B | +-------+-------+--------------------+ TABLE ItemProcurement +--------+-------------+------------+ | ItemID | CurrencyID | Amount | |--------+-------------+------------+ | 1 | 840 | 47.20 | +--------+-------------+------------+ | 2 | 826 | 3.10 | +--------+-------------+------------+ TABLE Currencies +------------+---------+-----------------+ | CurrencyID | ISOCode | Description | |------------+---------+-----------------+ | 840 | USD | US dollars | +------------+---------+-----------------+ | 826 | GBP | British Pounds | +------------+---------+-----------------+ </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload