Table
order_line
Products and quantities in an order, with the price charged.
Replaces in 2020: Invoices
Rows 2,701–2,725 of 5,412
| order_id→ purchase_order.order_id | product_id→ product.product_id | quantityINTEGER | unit_price_centsINTEGER |
|---|---|---|---|
| 2701 | 2 | 2 | 1700 |
| 2702 | 2 | 2 | 1700 |
| 2703 | 3 | 1 | 800 |
| 2704 | 3 | 1 | 800 |
| 2705 | 1 | 2 | 1500 |
| 2706 | 3 | 1 | 800 |
| 2707 | 2 | 4 | 1700 |
| 2708 | 2 | 2 | 1700 |
| 2709 | 2 | 1 | 1700 |
| 2710 | 1 | 2 | 1500 |
| 2711 | 4 | 1 | 400 |
| 2712 | 2 | 2 | 1700 |
| 2713 | 3 | 1 | 800 |
| 2714 | 1 | 1 | 1500 |
| 2715 | 1 | 2 | 1500 |
| 2716 | 2 | 2 | 1700 |
| 2717 | 2 | 1 | 1700 |
| 2718 | 4 | 1 | 400 |
| 2719 | 1 | 2 | 1500 |
| 2720 | 2 | 1 | 1700 |
| 2721 | 4 | 1 | 400 |
| 2722 | 4 | 1 | 400 |
| 2723 | 4 | 1 | 400 |
| 2724 | 2 | 1 | 1700 |
| 2725 | 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;