Table
order_line
Products and quantities in an order, with the price charged.
Replaces in 2020: Invoices
Rows 1,026–1,050 of 5,412
| order_id→ purchase_order.order_id | product_id→ product.product_id | quantityINTEGER | unit_price_centsINTEGER |
|---|---|---|---|
| 1026 | 1 | 3 | 1500 |
| 1027 | 1 | 4 | 1500 |
| 1028 | 1 | 2 | 1500 |
| 1029 | 1 | 4 | 1500 |
| 1030 | 2 | 2 | 1700 |
| 1031 | 1 | 2 | 1500 |
| 1032 | 4 | 1 | 400 |
| 1033 | 4 | 1 | 400 |
| 1034 | 1 | 2 | 1500 |
| 1035 | 4 | 1 | 400 |
| 1036 | 1 | 3 | 1500 |
| 1037 | 3 | 1 | 800 |
| 1038 | 2 | 5 | 1700 |
| 1039 | 2 | 2 | 1700 |
| 1040 | 4 | 1 | 400 |
| 1041 | 4 | 1 | 400 |
| 1042 | 1 | 2 | 1500 |
| 1043 | 1 | 5 | 1500 |
| 1044 | 1 | 5 | 1500 |
| 1045 | 1 | 2 | 1500 |
| 1046 | 1 | 2 | 1500 |
| 1047 | 4 | 1 | 400 |
| 1048 | 3 | 1 | 800 |
| 1049 | 1 | 4 | 1500 |
| 1050 | 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;