Table
order_line
Products and quantities in an order, with the price charged.
Replaces in 2020: Invoices
Rows 1,826–1,850 of 5,412
| order_id→ purchase_order.order_id | product_id→ product.product_id | quantityINTEGER | unit_price_centsINTEGER |
|---|---|---|---|
| 1826 | 4 | 1 | 400 |
| 1827 | 1 | 1 | 1500 |
| 1828 | 3 | 1 | 800 |
| 1829 | 3 | 1 | 800 |
| 1830 | 1 | 1 | 1500 |
| 1831 | 1 | 2 | 1500 |
| 1832 | 1 | 1 | 1500 |
| 1833 | 1 | 1 | 1500 |
| 1834 | 4 | 1 | 400 |
| 1835 | 2 | 1 | 1700 |
| 1836 | 1 | 40 | 1500 |
| 1837 | 1 | 3 | 1500 |
| 1838 | 4 | 1 | 400 |
| 1839 | 3 | 1 | 800 |
| 1840 | 3 | 1 | 800 |
| 1841 | 2 | 3 | 1700 |
| 1842 | 2 | 1 | 1700 |
| 1843 | 2 | 2 | 1700 |
| 1844 | 4 | 1 | 400 |
| 1845 | 4 | 1 | 400 |
| 1846 | 3 | 1 | 800 |
| 1847 | 4 | 1 | 400 |
| 1848 | 2 | 2 | 1700 |
| 1849 | 1 | 1 | 1500 |
| 1850 | 4 | 1 | 400 |
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;