Table
order_line
Products and quantities in an order, with the price charged.
Replaces in 2020: Invoices
Rows 2,026–2,050 of 5,412
| order_id→ purchase_order.order_id | product_id→ product.product_id | quantityINTEGER | unit_price_centsINTEGER |
|---|---|---|---|
| 2026 | 2 | 5 | 1700 |
| 2027 | 2 | 1 | 1700 |
| 2028 | 2 | 5 | 1700 |
| 2029 | 4 | 1 | 400 |
| 2030 | 3 | 1 | 800 |
| 2031 | 3 | 1 | 800 |
| 2032 | 1 | 3 | 1500 |
| 2033 | 2 | 1 | 1700 |
| 2034 | 2 | 2 | 1700 |
| 2035 | 1 | 4 | 1500 |
| 2036 | 1 | 2 | 1500 |
| 2037 | 1 | 1 | 1500 |
| 2038 | 1 | 2 | 1500 |
| 2039 | 4 | 1 | 400 |
| 2040 | 1 | 2 | 1500 |
| 2041 | 4 | 1 | 400 |
| 2042 | 3 | 1 | 800 |
| 2043 | 2 | 2 | 1700 |
| 2044 | 1 | 1 | 1500 |
| 2045 | 2 | 2 | 1700 |
| 2046 | 1 | 1 | 1500 |
| 2047 | 4 | 1 | 400 |
| 2048 | 2 | 2 | 1700 |
| 2049 | 1 | 2 | 1500 |
| 2050 | 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;