Table
order_line
Products and quantities in an order, with the price charged.
Replaces in 2020: Invoices
Rows 3,026–3,050 of 5,412
| order_id→ purchase_order.order_id | product_id→ product.product_id | quantityINTEGER | unit_price_centsINTEGER |
|---|---|---|---|
| 3026 | 1 | 4 | 1500 |
| 3027 | 1 | 1 | 1500 |
| 3028 | 2 | 2 | 1700 |
| 3029 | 3 | 1 | 800 |
| 3030 | 4 | 1 | 400 |
| 3031 | 4 | 1 | 400 |
| 3032 | 4 | 1 | 400 |
| 3033 | 1 | 2 | 1500 |
| 3034 | 2 | 2 | 1700 |
| 3035 | 2 | 2 | 1700 |
| 3036 | 3 | 1 | 800 |
| 3037 | 4 | 1 | 400 |
| 3038 | 1 | 1 | 1500 |
| 3039 | 1 | 1 | 1500 |
| 3040 | 1 | 2 | 1500 |
| 3041 | 1 | 2 | 1500 |
| 3042 | 1 | 1 | 1500 |
| 3043 | 2 | 2 | 1700 |
| 3044 | 2 | 3 | 1700 |
| 3045 | 3 | 1 | 800 |
| 3046 | 3 | 1 | 800 |
| 3047 | 2 | 2 | 1700 |
| 3048 | 1 | 2 | 1500 |
| 3049 | 1 | 5 | 1500 |
| 3050 | 2 | 3 | 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;