Table
order_line
Products and quantities in an order, with the price charged.
Replaces in 2020: Invoices
Rows 3,851–3,875 of 5,412
| order_id→ purchase_order.order_id | product_id→ product.product_id | quantityINTEGER | unit_price_centsINTEGER |
|---|---|---|---|
| 3851 | 1 | 2 | 1500 |
| 3852 | 1 | 1 | 1500 |
| 3853 | 2 | 1 | 1700 |
| 3854 | 2 | 2 | 1700 |
| 3855 | 1 | 2 | 1500 |
| 3856 | 2 | 1 | 1700 |
| 3857 | 3 | 1 | 800 |
| 3858 | 1 | 4 | 1500 |
| 3859 | 4 | 1 | 400 |
| 3860 | 1 | 1 | 1500 |
| 3861 | 1 | 4 | 1500 |
| 3862 | 2 | 1 | 1700 |
| 3863 | 2 | 5 | 1700 |
| 3864 | 3 | 1 | 800 |
| 3865 | 1 | 4 | 1500 |
| 3866 | 1 | 1 | 1500 |
| 3867 | 1 | 1 | 1500 |
| 3868 | 2 | 2 | 1700 |
| 3869 | 2 | 1 | 1700 |
| 3870 | 1 | 1 | 1500 |
| 3871 | 2 | 3 | 1700 |
| 3872 | 3 | 1 | 800 |
| 3873 | 1 | 1 | 1500 |
| 3874 | 2 | 1 | 1700 |
| 3875 | 3 | 1 | 800 |
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;