Table
order_line
Products and quantities in an order, with the price charged.
Replaces in 2020: Invoices
Rows 1,676–1,700 of 5,412
| order_id→ purchase_order.order_id | product_id→ product.product_id | quantityINTEGER | unit_price_centsINTEGER |
|---|---|---|---|
| 1676 | 3 | 1 | 800 |
| 1677 | 2 | 2 | 1700 |
| 1678 | 4 | 1 | 400 |
| 1679 | 4 | 1 | 400 |
| 1680 | 1 | 2 | 1500 |
| 1681 | 4 | 1 | 400 |
| 1682 | 4 | 1 | 400 |
| 1683 | 1 | 4 | 1500 |
| 1684 | 2 | 2 | 1700 |
| 1685 | 4 | 1 | 400 |
| 1686 | 1 | 39 | 1500 |
| 1687 | 4 | 1 | 400 |
| 1688 | 1 | 2 | 1500 |
| 1689 | 1 | 2 | 1500 |
| 1690 | 2 | 2 | 1700 |
| 1691 | 1 | 1 | 1500 |
| 1692 | 1 | 2 | 1500 |
| 1693 | 2 | 3 | 1700 |
| 1694 | 1 | 2 | 1500 |
| 1695 | 4 | 1 | 400 |
| 1696 | 2 | 4 | 1700 |
| 1697 | 1 | 2 | 1500 |
| 1698 | 4 | 1 | 400 |
| 1699 | 1 | 1 | 1500 |
| 1700 | 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;