Table
order_line
Products and quantities in an order, with the price charged.
Replaces in 2020: Invoices
Rows 2,851–2,875 of 5,412
| order_id→ purchase_order.order_id | product_id→ product.product_id | quantityINTEGER | unit_price_centsINTEGER |
|---|---|---|---|
| 2851 | 4 | 1 | 400 |
| 2852 | 4 | 1 | 400 |
| 2853 | 1 | 1 | 1500 |
| 2854 | 4 | 1 | 400 |
| 2855 | 2 | 3 | 1700 |
| 2856 | 3 | 1 | 800 |
| 2857 | 1 | 4 | 1500 |
| 2858 | 1 | 2 | 1500 |
| 2859 | 4 | 1 | 400 |
| 2860 | 4 | 1 | 400 |
| 2861 | 2 | 2 | 1700 |
| 2862 | 3 | 1 | 800 |
| 2863 | 3 | 1 | 800 |
| 2864 | 1 | 1 | 1500 |
| 2865 | 2 | 1 | 1700 |
| 2866 | 1 | 2 | 1500 |
| 2867 | 2 | 2 | 1700 |
| 2868 | 3 | 1 | 800 |
| 2869 | 1 | 4 | 1500 |
| 2870 | 1 | 3 | 1500 |
| 2871 | 2 | 1 | 1700 |
| 2872 | 4 | 1 | 400 |
| 2873 | 1 | 2 | 1500 |
| 2874 | 1 | 3 | 1500 |
| 2875 | 1 | 2 | 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;