Table
order_line
Products and quantities in an order, with the price charged.
Replaces in 2020: Invoices
Rows 701–725 of 5,412
| order_id→ purchase_order.order_id | product_id→ product.product_id | quantityINTEGER | unit_price_centsINTEGER |
|---|---|---|---|
| 701 | 1 | 2 | 1500 |
| 702 | 1 | 2 | 1500 |
| 703 | 4 | 1 | 400 |
| 704 | 4 | 1 | 400 |
| 705 | 4 | 1 | 400 |
| 706 | 4 | 1 | 400 |
| 707 | 2 | 1 | 1700 |
| 708 | 4 | 1 | 400 |
| 709 | 1 | 4 | 1500 |
| 710 | 2 | 3 | 1700 |
| 711 | 3 | 1 | 800 |
| 712 | 1 | 2 | 1500 |
| 713 | 2 | 4 | 1700 |
| 714 | 2 | 2 | 1700 |
| 715 | 4 | 1 | 400 |
| 716 | 4 | 1 | 400 |
| 717 | 2 | 2 | 1700 |
| 718 | 4 | 1 | 400 |
| 719 | 2 | 3 | 1700 |
| 720 | 1 | 2 | 1500 |
| 721 | 1 | 2 | 1500 |
| 722 | 2 | 1 | 1700 |
| 723 | 2 | 1 | 1700 |
| 724 | 3 | 1 | 800 |
| 725 | 2 | 2 | 1700 |
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;