Table
order_line
Products and quantities in an order, with the price charged.
Replaces in 2020: Invoices
Rows 4,476–4,500 of 5,412
| order_id→ purchase_order.order_id | product_id→ product.product_id | quantityINTEGER | unit_price_centsINTEGER |
|---|---|---|---|
| 4476 | 1 | 2 | 1500 |
| 4477 | 1 | 2 | 1500 |
| 4478 | 1 | 2 | 1500 |
| 4479 | 4 | 1 | 400 |
| 4480 | 1 | 2 | 1500 |
| 4481 | 1 | 1 | 1500 |
| 4482 | 1 | 2 | 1500 |
| 4483 | 1 | 2 | 1500 |
| 4484 | 1 | 2 | 1500 |
| 4485 | 2 | 1 | 1700 |
| 4486 | 3 | 1 | 800 |
| 4487 | 4 | 1 | 400 |
| 4488 | 1 | 2 | 1500 |
| 4489 | 1 | 2 | 1500 |
| 4490 | 3 | 1 | 800 |
| 4491 | 4 | 1 | 400 |
| 4492 | 1 | 1 | 1500 |
| 4493 | 1 | 2 | 1500 |
| 4494 | 1 | 2 | 1500 |
| 4495 | 2 | 1 | 1700 |
| 4496 | 2 | 2 | 1700 |
| 4497 | 2 | 1 | 1700 |
| 4498 | 3 | 1 | 800 |
| 4499 | 3 | 1 | 800 |
| 4500 | 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;