Table
order_line
Products and quantities in an order, with the price charged.
Replaces in 2020: Invoices
Rows 1,751–1,775 of 5,412
| order_id→ purchase_order.order_id | product_id→ product.product_id | quantityINTEGER | unit_price_centsINTEGER |
|---|---|---|---|
| 1751 | 1 | 3 | 1500 |
| 1752 | 1 | 3 | 1500 |
| 1753 | 3 | 1 | 800 |
| 1754 | 1 | 56 | 1500 |
| 1755 | 4 | 1 | 400 |
| 1756 | 2 | 1 | 1700 |
| 1757 | 1 | 5 | 1500 |
| 1758 | 1 | 1 | 1500 |
| 1759 | 2 | 1 | 1700 |
| 1760 | 3 | 1 | 800 |
| 1761 | 1 | 4 | 1500 |
| 1762 | 4 | 1 | 400 |
| 1763 | 1 | 1 | 1500 |
| 1764 | 2 | 1 | 1700 |
| 1765 | 3 | 1 | 800 |
| 1766 | 2 | 1 | 1700 |
| 1767 | 3 | 1 | 800 |
| 1768 | 1 | 4 | 1500 |
| 1769 | 1 | 1 | 1500 |
| 1770 | 1 | 4 | 1500 |
| 1771 | 1 | 3 | 1500 |
| 1772 | 4 | 1 | 400 |
| 1773 | 2 | 2 | 1700 |
| 1774 | 2 | 1 | 1700 |
| 1775 | 3 | 1 | 800 |
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;