Table
order_line
Products and quantities in an order, with the price charged.
Replaces in 2020: Invoices
Rows 2,876–2,900 of 5,412
| order_id→ purchase_order.order_id | product_id→ product.product_id | quantityINTEGER | unit_price_centsINTEGER |
|---|---|---|---|
| 2876 | 4 | 1 | 400 |
| 2877 | 4 | 1 | 400 |
| 2878 | 4 | 1 | 400 |
| 2879 | 1 | 1 | 1500 |
| 2880 | 2 | 3 | 1700 |
| 2881 | 3 | 1 | 800 |
| 2882 | 4 | 1 | 400 |
| 2883 | 1 | 1 | 1500 |
| 2884 | 4 | 1 | 400 |
| 2885 | 4 | 1 | 400 |
| 2886 | 4 | 1 | 400 |
| 2887 | 4 | 1 | 400 |
| 2888 | 1 | 2 | 1500 |
| 2889 | 4 | 1 | 400 |
| 2890 | 1 | 1 | 1500 |
| 2891 | 4 | 1 | 400 |
| 2892 | 2 | 2 | 1700 |
| 2893 | 3 | 1 | 800 |
| 2894 | 4 | 1 | 400 |
| 2895 | 1 | 1 | 1500 |
| 2896 | 4 | 1 | 400 |
| 2897 | 2 | 2 | 1700 |
| 2898 | 4 | 1 | 400 |
| 2899 | 1 | 2 | 1500 |
| 2900 | 1 | 1 | 1500 |
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;