Table
order_line
Products and quantities in an order, with the price charged.
Replaces in 2020: Invoices
Rows 1,651–1,675 of 5,412
| order_id→ purchase_order.order_id | product_id→ product.product_id | quantityINTEGER | unit_price_centsINTEGER |
|---|---|---|---|
| 1651 | 4 | 1 | 400 |
| 1652 | 2 | 2 | 1700 |
| 1653 | 2 | 2 | 1700 |
| 1654 | 1 | 2 | 1500 |
| 1655 | 1 | 2 | 1500 |
| 1656 | 4 | 1 | 400 |
| 1657 | 3 | 1 | 800 |
| 1658 | 4 | 1 | 400 |
| 1659 | 2 | 1 | 1700 |
| 1660 | 4 | 1 | 400 |
| 1661 | 4 | 1 | 400 |
| 1662 | 4 | 1 | 400 |
| 1663 | 1 | 2 | 1500 |
| 1664 | 2 | 5 | 1700 |
| 1665 | 2 | 2 | 1700 |
| 1666 | 1 | 4 | 1500 |
| 1667 | 4 | 1 | 400 |
| 1668 | 2 | 2 | 1700 |
| 1669 | 4 | 1 | 400 |
| 1670 | 4 | 1 | 400 |
| 1671 | 1 | 2 | 1500 |
| 1672 | 1 | 3 | 1500 |
| 1673 | 4 | 1 | 400 |
| 1674 | 1 | 1 | 1500 |
| 1675 | 2 | 1 | 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;