Table
order_line
Products and quantities in an order, with the price charged.
Replaces in 2020: Invoices
Rows 3,201–3,225 of 5,412
| order_id→ purchase_order.order_id | product_id→ product.product_id | quantityINTEGER | unit_price_centsINTEGER |
|---|---|---|---|
| 3201 | 3 | 1 | 800 |
| 3202 | 4 | 1 | 400 |
| 3203 | 2 | 2 | 1700 |
| 3204 | 3 | 1 | 800 |
| 3205 | 3 | 1 | 800 |
| 3206 | 2 | 2 | 1700 |
| 3207 | 3 | 1 | 800 |
| 3208 | 3 | 1 | 800 |
| 3209 | 2 | 1 | 1700 |
| 3210 | 2 | 1 | 1700 |
| 3211 | 1 | 5 | 1500 |
| 3212 | 1 | 4 | 1500 |
| 3213 | 1 | 2 | 1500 |
| 3214 | 4 | 1 | 400 |
| 3215 | 2 | 4 | 1700 |
| 3216 | 2 | 4 | 1700 |
| 3217 | 3 | 1 | 800 |
| 3218 | 1 | 2 | 1500 |
| 3219 | 4 | 1 | 400 |
| 3220 | 1 | 2 | 1500 |
| 3221 | 3 | 1 | 800 |
| 3222 | 3 | 1 | 800 |
| 3223 | 3 | 1 | 800 |
| 3224 | 1 | 1 | 1500 |
| 3225 | 2 | 4 | 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;