Table
order_line
Products and quantities in an order, with the price charged.
Replaces in 2020: Invoices
Rows 3,601–3,625 of 5,412
| order_id→ purchase_order.order_id | product_id→ product.product_id | quantityINTEGER | unit_price_centsINTEGER |
|---|---|---|---|
| 3601 | 1 | 2 | 1500 |
| 3602 | 2 | 4 | 1700 |
| 3603 | 3 | 1 | 800 |
| 3604 | 1 | 1 | 1500 |
| 3605 | 1 | 3 | 1500 |
| 3606 | 1 | 1 | 1500 |
| 3607 | 3 | 1 | 800 |
| 3608 | 1 | 36 | 1500 |
| 3609 | 2 | 2 | 1700 |
| 3610 | 1 | 3 | 1500 |
| 3611 | 4 | 1 | 400 |
| 3612 | 1 | 1 | 1500 |
| 3613 | 1 | 1 | 1500 |
| 3614 | 3 | 1 | 800 |
| 3615 | 1 | 1 | 1500 |
| 3616 | 2 | 2 | 1700 |
| 3617 | 3 | 1 | 800 |
| 3618 | 3 | 1 | 800 |
| 3619 | 1 | 2 | 1500 |
| 3620 | 2 | 1 | 1700 |
| 3621 | 3 | 1 | 800 |
| 3622 | 2 | 1 | 1700 |
| 3623 | 1 | 3 | 1500 |
| 3624 | 1 | 2 | 1500 |
| 3625 | 2 | 1 | 1700 |
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;