Table
order_line
Products and quantities in an order, with the price charged.
Replaces in 2020: Invoices
Rows 2,251–2,275 of 5,412
| order_id→ purchase_order.order_id | product_id→ product.product_id | quantityINTEGER | unit_price_centsINTEGER |
|---|---|---|---|
| 2251 | 2 | 1 | 1700 |
| 2252 | 1 | 1 | 1500 |
| 2253 | 4 | 1 | 400 |
| 2254 | 3 | 1 | 800 |
| 2255 | 2 | 2 | 1700 |
| 2256 | 2 | 1 | 1700 |
| 2257 | 2 | 2 | 1700 |
| 2258 | 3 | 1 | 800 |
| 2259 | 3 | 1 | 800 |
| 2260 | 3 | 1 | 800 |
| 2261 | 1 | 2 | 1500 |
| 2262 | 1 | 1 | 1500 |
| 2263 | 1 | 1 | 1500 |
| 2264 | 1 | 1 | 1500 |
| 2265 | 4 | 1 | 400 |
| 2266 | 1 | 2 | 1500 |
| 2267 | 1 | 1 | 1500 |
| 2268 | 1 | 1 | 1500 |
| 2269 | 3 | 1 | 800 |
| 2270 | 2 | 1 | 1700 |
| 2271 | 2 | 2 | 1700 |
| 2272 | 2 | 3 | 1700 |
| 2273 | 3 | 1 | 800 |
| 2274 | 2 | 1 | 1700 |
| 2275 | 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;