I want to know how to design invoice table.
An invoice include many orders from order table.
Is this invoices table is correctly designed?
order
- order_id (PK)
- User_id (FK)
- total_cost
- order_date
- status
order_item
- order_item_id (PK)
- order_id (FK)
- item_name
- cost
invoice table
- invoice_id (PK)
- invoice_no
- invoice_date
- period_start_date
- period_end_date
- status
invoice_order (an invoice with many orders)
- invoice_order_id (PK)
- invoice_id (FK)
- order_id (FK)
Is invoice_order table necessarry?
I could add invoice_id (FK) field in the order_table instead. The "order. invoice_id" would be updated when I have added a row in the invoice table.
invoice designquestions the last days ... - ypercubeᵀᴹ