Table
order_line
Products and quantities in an order, with the price charged.
Replaces in 2020: Invoices
Rows 3,726–3,750 of 5,412
| order_id→ purchase_order.order_id | product_id→ product.product_id | quantityINTEGER | unit_price_centsINTEGER |
|---|---|---|---|
| 3726 | 1 | 4 | 1500 |
| 3727 | 3 | 1 | 800 |
| 3728 | 1 | 2 | 1500 |
| 3729 | 4 | 1 | 400 |
| 3730 | 1 | 39 | 1500 |
| 3731 | 1 | 2 | 1500 |
| 3732 | 1 | 1 | 1500 |
| 3733 | 2 | 2 | 1700 |
| 3734 | 1 | 2 | 1500 |
| 3735 | 1 | 3 | 1500 |
| 3736 | 1 | 1 | 1500 |
| 3737 | 4 | 1 | 400 |
| 3738 | 1 | 4 | 1500 |
| 3739 | 1 | 5 | 1500 |
| 3740 | 1 | 1 | 1500 |
| 3741 | 4 | 1 | 400 |
| 3742 | 4 | 1 | 400 |
| 3743 | 4 | 1 | 400 |
| 3744 | 4 | 1 | 400 |
| 3745 | 2 | 2 | 1700 |
| 3746 | 3 | 1 | 800 |
| 3747 | 2 | 1 | 1700 |
| 3748 | 2 | 1 | 1700 |
| 3749 | 3 | 1 | 800 |
| 3750 | 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;