Table
order_line
Products and quantities in an order, with the price charged.
Replaces in 2020: Invoices
Rows 851–875 of 5,412
| order_id→ purchase_order.order_id | product_id→ product.product_id | quantityINTEGER | unit_price_centsINTEGER |
|---|---|---|---|
| 851 | 2 | 4 | 1700 |
| 852 | 2 | 1 | 1700 |
| 853 | 3 | 1 | 800 |
| 854 | 2 | 2 | 1700 |
| 855 | 3 | 1 | 800 |
| 856 | 2 | 4 | 1700 |
| 857 | 4 | 1 | 400 |
| 858 | 2 | 1 | 1700 |
| 859 | 4 | 1 | 400 |
| 860 | 2 | 1 | 1700 |
| 861 | 2 | 5 | 1700 |
| 862 | 2 | 1 | 1700 |
| 863 | 1 | 1 | 1500 |
| 864 | 2 | 3 | 1700 |
| 865 | 4 | 1 | 400 |
| 866 | 4 | 1 | 400 |
| 867 | 4 | 1 | 400 |
| 868 | 1 | 1 | 1500 |
| 869 | 4 | 1 | 400 |
| 870 | 3 | 1 | 800 |
| 871 | 2 | 1 | 1700 |
| 872 | 2 | 1 | 1700 |
| 873 | 2 | 1 | 1700 |
| 874 | 3 | 1 | 800 |
| 875 | 2 | 1 | 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;