Table
order_line
Products and quantities in an order, with the price charged.
Replaces in 2020: Invoices
Rows 501–525 of 5,412
| order_id→ purchase_order.order_id | product_id→ product.product_id | quantityINTEGER | unit_price_centsINTEGER |
|---|---|---|---|
| 501 | 4 | 1 | 400 |
| 502 | 1 | 3 | 1500 |
| 503 | 4 | 1 | 400 |
| 504 | 2 | 2 | 1700 |
| 505 | 1 | 4 | 1500 |
| 506 | 2 | 2 | 1700 |
| 507 | 3 | 1 | 800 |
| 508 | 2 | 1 | 1700 |
| 509 | 3 | 1 | 800 |
| 510 | 1 | 3 | 1500 |
| 511 | 2 | 1 | 1700 |
| 512 | 1 | 2 | 1500 |
| 513 | 1 | 2 | 1500 |
| 514 | 4 | 1 | 400 |
| 515 | 2 | 2 | 1700 |
| 516 | 1 | 2 | 1500 |
| 517 | 4 | 1 | 400 |
| 518 | 2 | 2 | 1700 |
| 519 | 3 | 1 | 800 |
| 520 | 4 | 1 | 400 |
| 521 | 1 | 3 | 1500 |
| 522 | 4 | 1 | 400 |
| 523 | 1 | 4 | 1500 |
| 524 | 1 | 1 | 1500 |
| 525 | 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;