Table
order_line
Products and quantities in an order, with the price charged.
Replaces in 2020: Invoices
Rows 3,501–3,525 of 5,412
| order_id→ purchase_order.order_id | product_id→ product.product_id | quantityINTEGER | unit_price_centsINTEGER |
|---|---|---|---|
| 3501 | 2 | 1 | 1700 |
| 3502 | 1 | 1 | 1500 |
| 3503 | 2 | 2 | 1700 |
| 3504 | 2 | 1 | 1700 |
| 3505 | 1 | 2 | 1500 |
| 3506 | 3 | 1 | 800 |
| 3507 | 1 | 1 | 1500 |
| 3508 | 2 | 4 | 1700 |
| 3509 | 3 | 1 | 800 |
| 3510 | 1 | 4 | 1500 |
| 3511 | 1 | 2 | 1500 |
| 3512 | 4 | 1 | 400 |
| 3513 | 1 | 1 | 1500 |
| 3514 | 1 | 33 | 1500 |
| 3515 | 2 | 4 | 1700 |
| 3516 | 3 | 1 | 800 |
| 3517 | 3 | 1 | 800 |
| 3518 | 2 | 2 | 1700 |
| 3519 | 3 | 1 | 800 |
| 3520 | 3 | 1 | 800 |
| 3521 | 2 | 1 | 1700 |
| 3522 | 2 | 4 | 1700 |
| 3523 | 3 | 1 | 800 |
| 3524 | 4 | 1 | 400 |
| 3525 | 1 | 1 | 1500 |
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;