Table
order_line
Products and quantities in an order, with the price charged.
Replaces in 2020: Invoices
Rows 2,976–3,000 of 5,412
| order_id→ purchase_order.order_id | product_id→ product.product_id | quantityINTEGER | unit_price_centsINTEGER |
|---|---|---|---|
| 2976 | 1 | 2 | 1500 |
| 2977 | 4 | 1 | 400 |
| 2978 | 1 | 1 | 1500 |
| 2979 | 4 | 1 | 400 |
| 2980 | 1 | 2 | 1500 |
| 2981 | 1 | 1 | 1500 |
| 2982 | 2 | 4 | 1700 |
| 2983 | 1 | 1 | 1500 |
| 2984 | 2 | 1 | 1700 |
| 2985 | 1 | 1 | 1500 |
| 2986 | 2 | 2 | 1700 |
| 2987 | 1 | 1 | 1500 |
| 2988 | 1 | 2 | 1500 |
| 2989 | 4 | 1 | 400 |
| 2990 | 1 | 4 | 1500 |
| 2991 | 4 | 1 | 400 |
| 2992 | 1 | 2 | 1500 |
| 2993 | 1 | 2 | 1500 |
| 2994 | 4 | 1 | 400 |
| 2995 | 4 | 1 | 400 |
| 2996 | 2 | 2 | 1700 |
| 2997 | 2 | 2 | 1700 |
| 2998 | 3 | 1 | 800 |
| 2999 | 3 | 1 | 800 |
| 3000 | 1 | 50 | 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;