vendredi 13 décembre 2019

Invoice system normalization \ denormalization

We have a two tables:

Invoices

enter image description here

And Invoice items

enter image description here

Each invoice has multiple items.

So my question is: Should we store the invoice subtotal (each item price) and total (subtotal+tax) in the invoice table, and get that fields by simple SELECT, or SUM the prices of each item to get the subtotal and SUM with tax to get the total by joining two tables?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire