Table
order_line
Products and quantities in an order, with the price charged.
Replaces in 2020: Invoices
Rows 1,101–1,125 of 5,412
| order_id→ purchase_order.order_id | product_id→ product.product_id | quantityINTEGER | unit_price_centsINTEGER |
|---|---|---|---|
| 1101 | 2 | 1 | 1700 |
| 1102 | 4 | 1 | 400 |
| 1103 | 1 | 5 | 1500 |
| 1104 | 1 | 3 | 1500 |
| 1105 | 2 | 2 | 1700 |
| 1106 | 3 | 1 | 800 |
| 1107 | 3 | 1 | 800 |
| 1108 | 3 | 1 | 800 |
| 1109 | 2 | 2 | 1700 |
| 1110 | 3 | 1 | 800 |
| 1111 | 3 | 1 | 800 |
| 1112 | 4 | 1 | 400 |
| 1113 | 4 | 1 | 400 |
| 1114 | 4 | 1 | 400 |
| 1115 | 1 | 3 | 1500 |
| 1116 | 2 | 1 | 1700 |
| 1117 | 1 | 1 | 1500 |
| 1118 | 2 | 1 | 1700 |
| 1119 | 2 | 4 | 1700 |
| 1120 | 1 | 4 | 1500 |
| 1121 | 2 | 2 | 1700 |
| 1122 | 2 | 2 | 1700 |
| 1123 | 3 | 1 | 800 |
| 1124 | 2 | 4 | 1700 |
| 1125 | 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;