Table
order_line
Products and quantities in an order, with the price charged.
Replaces in 2020: Invoices
Rows 3,351–3,375 of 5,412
| order_id→ purchase_order.order_id | product_id→ product.product_id | quantityINTEGER | unit_price_centsINTEGER |
|---|---|---|---|
| 3351 | 1 | 2 | 1500 |
| 3352 | 1 | 1 | 1500 |
| 3353 | 1 | 1 | 1500 |
| 3354 | 2 | 1 | 1700 |
| 3355 | 4 | 1 | 400 |
| 3356 | 3 | 1 | 800 |
| 3357 | 1 | 2 | 1500 |
| 3358 | 1 | 3 | 1500 |
| 3359 | 2 | 3 | 1700 |
| 3360 | 3 | 1 | 800 |
| 3361 | 1 | 1 | 1500 |
| 3362 | 1 | 1 | 1500 |
| 3363 | 4 | 1 | 400 |
| 3364 | 4 | 1 | 400 |
| 3365 | 1 | 5 | 1500 |
| 3366 | 4 | 1 | 400 |
| 3367 | 1 | 2 | 1500 |
| 3368 | 1 | 3 | 1500 |
| 3369 | 1 | 4 | 1500 |
| 3370 | 1 | 2 | 1500 |
| 3371 | 1 | 1 | 1500 |
| 3372 | 4 | 1 | 400 |
| 3373 | 3 | 1 | 800 |
| 3374 | 1 | 1 | 1500 |
| 3375 | 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;