Table
order_line
Products and quantities in an order, with the price charged.
Replaces in 2020: Invoices
Rows 2,051–2,075 of 5,412
| order_id→ purchase_order.order_id | product_id→ product.product_id | quantityINTEGER | unit_price_centsINTEGER |
|---|---|---|---|
| 2051 | 1 | 2 | 1500 |
| 2052 | 4 | 1 | 400 |
| 2053 | 1 | 4 | 1500 |
| 2054 | 2 | 1 | 1700 |
| 2055 | 3 | 1 | 800 |
| 2056 | 1 | 5 | 1500 |
| 2057 | 1 | 1 | 1500 |
| 2058 | 1 | 5 | 1500 |
| 2059 | 1 | 4 | 1500 |
| 2060 | 1 | 1 | 1500 |
| 2061 | 3 | 1 | 800 |
| 2062 | 2 | 1 | 1700 |
| 2063 | 1 | 2 | 1500 |
| 2064 | 3 | 1 | 800 |
| 2065 | 4 | 1 | 400 |
| 2066 | 1 | 1 | 1500 |
| 2067 | 2 | 4 | 1700 |
| 2068 | 3 | 1 | 800 |
| 2069 | 1 | 1 | 1500 |
| 2070 | 1 | 4 | 1500 |
| 2071 | 1 | 1 | 1500 |
| 2072 | 4 | 1 | 400 |
| 2073 | 3 | 1 | 800 |
| 2074 | 1 | 4 | 1500 |
| 2075 | 1 | 1 | 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;