Table
order_line
Products and quantities in an order, with the price charged.
Replaces in 2020: Invoices
Rows 3,701–3,725 of 5,412
| order_id→ purchase_order.order_id | product_id→ product.product_id | quantityINTEGER | unit_price_centsINTEGER |
|---|---|---|---|
| 3701 | 2 | 1 | 1700 |
| 3702 | 2 | 2 | 1700 |
| 3703 | 1 | 1 | 1500 |
| 3704 | 1 | 2 | 1500 |
| 3705 | 2 | 4 | 1700 |
| 3706 | 3 | 1 | 800 |
| 3707 | 3 | 1 | 800 |
| 3708 | 3 | 1 | 800 |
| 3709 | 2 | 1 | 1700 |
| 3710 | 3 | 1 | 800 |
| 3711 | 4 | 1 | 400 |
| 3712 | 4 | 1 | 400 |
| 3713 | 1 | 1 | 1500 |
| 3714 | 3 | 1 | 800 |
| 3715 | 1 | 2 | 1500 |
| 3716 | 2 | 2 | 1700 |
| 3717 | 3 | 1 | 800 |
| 3718 | 1 | 1 | 1500 |
| 3719 | 4 | 1 | 400 |
| 3720 | 1 | 2 | 1500 |
| 3721 | 1 | 2 | 1500 |
| 3722 | 1 | 2 | 1500 |
| 3723 | 4 | 1 | 400 |
| 3724 | 1 | 1 | 1500 |
| 3725 | 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;