Table
order_line
Products and quantities in an order, with the price charged.
Replaces in 2020: Invoices
Rows 4,501–4,525 of 5,412
| order_id→ purchase_order.order_id | product_id→ product.product_id | quantityINTEGER | unit_price_centsINTEGER |
|---|---|---|---|
| 4501 | 3 | 1 | 800 |
| 4502 | 1 | 3 | 1500 |
| 4503 | 1 | 1 | 1500 |
| 4504 | 2 | 1 | 1700 |
| 4505 | 2 | 2 | 1700 |
| 4506 | 3 | 1 | 800 |
| 4507 | 3 | 1 | 800 |
| 4508 | 2 | 2 | 1700 |
| 4509 | 3 | 1 | 800 |
| 4510 | 4 | 1 | 400 |
| 4511 | 4 | 1 | 400 |
| 4512 | 1 | 5 | 1500 |
| 4513 | 2 | 4 | 1700 |
| 4514 | 3 | 1 | 800 |
| 4515 | 1 | 2 | 1500 |
| 4516 | 1 | 2 | 1500 |
| 4517 | 1 | 3 | 1500 |
| 4518 | 1 | 2 | 1500 |
| 4519 | 4 | 1 | 400 |
| 4520 | 2 | 2 | 1700 |
| 4521 | 1 | 3 | 1500 |
| 4522 | 1 | 2 | 1500 |
| 4523 | 1 | 2 | 1500 |
| 4524 | 1 | 5 | 1500 |
| 4525 | 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;