Hello to everybody,
I want to create a database that (among other things) will be storing invoices coming from suppliers. These invoices have a single number, multiple products with their respective prices and tax (each product can have different tax, 9% or 19%, but that can change in the future).
I have already created a PRODUCTS table, where each product has an ID, a name, a stock count (how many pieces are currently in stock) and a supplier.
My initial thought is to create two different tables:
- One table would include the InvoiceID, date of issue, supplier'sID, total cost (no tax) and total cost (including tax) for all products mentioned in the invoice
- The other table would include the same InvoiceID, the productID, the price (no tax), the tax and the pieces count.
My problems are:
1. is this the correct way to approach the database or am I running towards trouble?
2. if it is the correct way, how do I implement it?
Thank you in advance,
Alexander
I want to create a database that (among other things) will be storing invoices coming from suppliers. These invoices have a single number, multiple products with their respective prices and tax (each product can have different tax, 9% or 19%, but that can change in the future).
I have already created a PRODUCTS table, where each product has an ID, a name, a stock count (how many pieces are currently in stock) and a supplier.
My initial thought is to create two different tables:
- One table would include the InvoiceID, date of issue, supplier'sID, total cost (no tax) and total cost (including tax) for all products mentioned in the invoice
- The other table would include the same InvoiceID, the productID, the price (no tax), the tax and the pieces count.
My problems are:
1. is this the correct way to approach the database or am I running towards trouble?
2. if it is the correct way, how do I implement it?
Thank you in advance,
Alexander