Table
order_line
Products and quantities in an order, with the price charged.
Replaces in 2020: Invoices
Rows 4,776–4,800 of 5,412
| order_id→ purchase_order.order_id | product_id→ product.product_id | quantityINTEGER | unit_price_centsINTEGER |
|---|---|---|---|
| 4776 | 1 | 2 | 1500 |
| 4777 | 1 | 1 | 1500 |
| 4778 | 1 | 2 | 1500 |
| 4779 | 3 | 1 | 800 |
| 4780 | 4 | 1 | 400 |
| 4781 | 1 | 1 | 1500 |
| 4782 | 3 | 1 | 800 |
| 4783 | 2 | 1 | 1700 |
| 4784 | 1 | 2 | 1500 |
| 4785 | 2 | 1 | 1700 |
| 4786 | 2 | 2 | 1700 |
| 4787 | 4 | 1 | 400 |
| 4788 | 1 | 2 | 1500 |
| 4789 | 4 | 1 | 400 |
| 4790 | 1 | 2 | 1500 |
| 4791 | 3 | 1 | 800 |
| 4792 | 4 | 1 | 400 |
| 4793 | 1 | 2 | 1500 |
| 4794 | 1 | 1 | 1500 |
| 4795 | 2 | 2 | 1700 |
| 4796 | 1 | 2 | 1500 |
| 4797 | 1 | 1 | 1500 |
| 4798 | 2 | 1 | 1700 |
| 4799 | 1 | 2 | 1500 |
| 4800 | 4 | 1 | 400 |
Table definition
CREATE TABLE order_line (
order_id INTEGER NOT NULL REFERENCES purchase_order (order_id),
product_id INTEGER NOT NULL REFERENCES product (product_id),
quantity INTEGER NOT NULL CHECK (quantity > 0),
unit_price_cents INTEGER NOT NULL CHECK (unit_price_cents >= 0),
PRIMARY KEY (order_id, product_id)
) STRICT;