Table
order_line
Products and quantities in an order, with the price charged.
Replaces in 2020: Invoices
Rows 2,501–2,525 of 5,412
| order_id→ purchase_order.order_id | product_id→ product.product_id | quantityINTEGER | unit_price_centsINTEGER |
|---|---|---|---|
| 2501 | 2 | 1 | 1700 |
| 2502 | 2 | 3 | 1700 |
| 2503 | 1 | 5 | 1500 |
| 2504 | 1 | 3 | 1500 |
| 2505 | 2 | 5 | 1700 |
| 2506 | 2 | 1 | 1700 |
| 2507 | 3 | 1 | 800 |
| 2508 | 3 | 1 | 800 |
| 2509 | 4 | 1 | 400 |
| 2510 | 1 | 2 | 1500 |
| 2511 | 1 | 1 | 1500 |
| 2512 | 3 | 1 | 800 |
| 2513 | 3 | 1 | 800 |
| 2514 | 1 | 1 | 1500 |
| 2515 | 1 | 1 | 1500 |
| 2516 | 2 | 1 | 1700 |
| 2517 | 3 | 1 | 800 |
| 2518 | 4 | 1 | 400 |
| 2519 | 1 | 4 | 1500 |
| 2520 | 1 | 1 | 1500 |
| 2521 | 3 | 1 | 800 |
| 2522 | 1 | 2 | 1500 |
| 2523 | 1 | 3 | 1500 |
| 2524 | 4 | 1 | 400 |
| 2525 | 1 | 3 | 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;