Table
order_line
Products and quantities in an order, with the price charged.
Replaces in 2020: Invoices
Rows 2,726–2,750 of 5,412
| order_id→ purchase_order.order_id | product_id→ product.product_id | quantityINTEGER | unit_price_centsINTEGER |
|---|---|---|---|
| 2726 | 1 | 4 | 1500 |
| 2727 | 1 | 1 | 1500 |
| 2728 | 4 | 1 | 400 |
| 2729 | 2 | 4 | 1700 |
| 2730 | 3 | 1 | 800 |
| 2731 | 3 | 1 | 800 |
| 2732 | 1 | 1 | 1500 |
| 2733 | 1 | 2 | 1500 |
| 2734 | 1 | 2 | 1500 |
| 2735 | 4 | 1 | 400 |
| 2736 | 1 | 3 | 1500 |
| 2737 | 4 | 1 | 400 |
| 2738 | 1 | 2 | 1500 |
| 2739 | 4 | 1 | 400 |
| 2740 | 4 | 1 | 400 |
| 2741 | 2 | 3 | 1700 |
| 2742 | 1 | 1 | 1500 |
| 2743 | 3 | 1 | 800 |
| 2744 | 3 | 1 | 800 |
| 2745 | 4 | 1 | 400 |
| 2746 | 4 | 1 | 400 |
| 2747 | 1 | 3 | 1500 |
| 2748 | 3 | 1 | 800 |
| 2749 | 1 | 1 | 1500 |
| 2750 | 2 | 4 | 1700 |
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;