Table
order_line
Products and quantities in an order, with the price charged.
Replaces in 2020: Invoices
Rows 3,101–3,125 of 5,412
| order_id→ purchase_order.order_id | product_id→ product.product_id | quantityINTEGER | unit_price_centsINTEGER |
|---|---|---|---|
| 3101 | 2 | 2 | 1700 |
| 3102 | 4 | 1 | 400 |
| 3103 | 1 | 1 | 1500 |
| 3104 | 2 | 3 | 1700 |
| 3105 | 1 | 1 | 1500 |
| 3106 | 3 | 1 | 800 |
| 3107 | 1 | 2 | 1500 |
| 3108 | 2 | 5 | 1700 |
| 3109 | 3 | 1 | 800 |
| 3110 | 4 | 1 | 400 |
| 3111 | 1 | 1 | 1500 |
| 3112 | 1 | 2 | 1500 |
| 3113 | 2 | 1 | 1700 |
| 3114 | 1 | 1 | 1500 |
| 3115 | 1 | 4 | 1500 |
| 3116 | 4 | 1 | 400 |
| 3117 | 3 | 1 | 800 |
| 3118 | 1 | 4 | 1500 |
| 3119 | 4 | 1 | 400 |
| 3120 | 1 | 1 | 1500 |
| 3121 | 2 | 1 | 1700 |
| 3122 | 3 | 1 | 800 |
| 3123 | 1 | 1 | 1500 |
| 3124 | 1 | 2 | 1500 |
| 3125 | 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;