Table
order_line
Products and quantities in an order, with the price charged.
Replaces in 2020: Invoices
Rows 3,226–3,250 of 5,412
| order_id→ purchase_order.order_id | product_id→ product.product_id | quantityINTEGER | unit_price_centsINTEGER |
|---|---|---|---|
| 3226 | 3 | 1 | 800 |
| 3227 | 3 | 1 | 800 |
| 3228 | 2 | 1 | 1700 |
| 3229 | 1 | 2 | 1500 |
| 3230 | 1 | 2 | 1500 |
| 3231 | 4 | 1 | 400 |
| 3232 | 3 | 1 | 800 |
| 3233 | 3 | 1 | 800 |
| 3234 | 3 | 1 | 800 |
| 3235 | 3 | 1 | 800 |
| 3236 | 1 | 2 | 1500 |
| 3237 | 4 | 1 | 400 |
| 3238 | 1 | 2 | 1500 |
| 3239 | 4 | 1 | 400 |
| 3240 | 2 | 1 | 1700 |
| 3241 | 2 | 1 | 1700 |
| 3242 | 3 | 1 | 800 |
| 3243 | 3 | 1 | 800 |
| 3244 | 1 | 4 | 1500 |
| 3245 | 1 | 2 | 1500 |
| 3246 | 4 | 1 | 400 |
| 3247 | 4 | 1 | 400 |
| 3248 | 3 | 1 | 800 |
| 3249 | 1 | 1 | 1500 |
| 3250 | 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;