Table
order_line
Products and quantities in an order, with the price charged.
Replaces in 2020: Invoices
Rows 1,726–1,750 of 5,412
| order_id→ purchase_order.order_id | product_id→ product.product_id | quantityINTEGER | unit_price_centsINTEGER |
|---|---|---|---|
| 1726 | 3 | 1 | 800 |
| 1727 | 3 | 1 | 800 |
| 1728 | 1 | 1 | 1500 |
| 1729 | 2 | 3 | 1700 |
| 1730 | 2 | 1 | 1700 |
| 1731 | 3 | 1 | 800 |
| 1732 | 2 | 2 | 1700 |
| 1733 | 3 | 1 | 800 |
| 1734 | 1 | 4 | 1500 |
| 1735 | 2 | 2 | 1700 |
| 1736 | 4 | 1 | 400 |
| 1737 | 1 | 2 | 1500 |
| 1738 | 3 | 1 | 800 |
| 1739 | 4 | 1 | 400 |
| 1740 | 2 | 4 | 1700 |
| 1741 | 3 | 1 | 800 |
| 1742 | 3 | 1 | 800 |
| 1743 | 3 | 1 | 800 |
| 1744 | 1 | 1 | 1500 |
| 1745 | 4 | 1 | 400 |
| 1746 | 2 | 1 | 1700 |
| 1747 | 1 | 4 | 1500 |
| 1748 | 4 | 1 | 400 |
| 1749 | 4 | 1 | 400 |
| 1750 | 2 | 2 | 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;