Table
order_line
Products and quantities in an order, with the price charged.
Replaces in 2020: Invoices
Rows 1,176–1,200 of 5,412
| order_id→ purchase_order.order_id | product_id→ product.product_id | quantityINTEGER | unit_price_centsINTEGER |
|---|---|---|---|
| 1176 | 4 | 1 | 400 |
| 1177 | 4 | 1 | 400 |
| 1178 | 2 | 2 | 1700 |
| 1179 | 1 | 2 | 1500 |
| 1180 | 3 | 1 | 800 |
| 1181 | 2 | 2 | 1700 |
| 1182 | 3 | 1 | 800 |
| 1183 | 1 | 3 | 1500 |
| 1184 | 1 | 2 | 1500 |
| 1185 | 1 | 2 | 1500 |
| 1186 | 2 | 1 | 1700 |
| 1187 | 1 | 1 | 1500 |
| 1188 | 2 | 2 | 1700 |
| 1189 | 2 | 1 | 1700 |
| 1190 | 3 | 1 | 800 |
| 1191 | 4 | 1 | 400 |
| 1192 | 4 | 1 | 400 |
| 1193 | 4 | 1 | 400 |
| 1194 | 1 | 3 | 1500 |
| 1195 | 4 | 1 | 400 |
| 1196 | 4 | 1 | 400 |
| 1197 | 1 | 1 | 1500 |
| 1198 | 2 | 1 | 1700 |
| 1199 | 4 | 1 | 400 |
| 1200 | 2 | 1 | 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;