Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to improve the fields name
    primarykey
    data
    text
    <p>I am trying to improve the fields name to be more obvious what it means.. is the fields name ok? or what can be changed to make it more obvious?</p> <pre><code>mysql&gt; select * from order_items; +----+----------+--------+----------+------------+-------+ | id | order_id | name | quantity | item_price | total | +----+----------+--------+----------+------------+-------+ | 1 | 5 | Item 1 | 2 | 3.00 | 6.00 | | 2 | 5 | Item 2 | 1 | 2.00 | 2.00 | +----+----------+--------+----------+------------+-------+ mysql&gt; select * from orders; +----+---------+---------+-----------------+---------------+----------------+----------+---------------+------------+----------------+------------+----------------------+--------------------+--------------------+----------------------+ | id | shop_id | user_id | shipping_method | shipping_fees | payment_method | card_fee | commision_fee | item_total | customer_total | shop_total | shop_total_remaining | our_commission_net | our_commission_vat | our_commission_gross | +----+---------+---------+-----------------+---------------+----------------+----------+---------------+------------+----------------+------------+----------------------+--------------------+--------------------+----------------------+ | 5 | 29 | 9 | delivery | 1.00 | card | 0.50 | 13 | 8.00 | 9.50 | 9.00 | 7.83 | 1.17 | 0.23 | 1.40 | +----+---------+---------+-----------------+---------------+----------------+----------+---------------+------------+----------------+------------+----------------------+--------------------+--------------------+----------------------+ </code></pre> <p><strong>Fields name description:</strong></p> <ul> <li><p><code>item_total</code> Total cost from order_items.order_id = 5</p></li> <li><p><code>customer_total</code> Total cost for customer to pay (<code>item_total</code> + <code>card_fee</code> + <code>shipping_fee</code>)</p></li> <li><p><code>shop_total</code> Total order for the shop (<code>item_total</code> + <code>shipping_fees</code>)</p></li> <li><p><code>shop_total_remaining</code> Total remaining to pay back to shop (<code>shop_total</code> - <code>our_commission_net</code>)</p></li> <li><p><code>our_commission_net</code> Commission I will make (<code>commission_fee</code> * <code>shop_total</code> / 100)</p></li> <li><p><code>our_commission_gross</code> Commission inc VAT (<code>our_commission_net</code> + <code>our_commission_vat</code>)</p></li> </ul> <p>Did I add unnecessary fields? </p> <p>I used PHP to calculate the cost.</p>
    singulars
    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.
 

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