Table
order_line
Products and quantities in an order, with the price charged.
Replaces in 2020: Invoices
Rows 1,301–1,325 of 5,412
| order_id→ purchase_order.order_id | product_id→ product.product_id | quantityINTEGER | unit_price_centsINTEGER |
|---|---|---|---|
| 1301 | 2 | 1 | 1700 |
| 1302 | 2 | 3 | 1700 |
| 1303 | 1 | 1 | 1500 |
| 1304 | 1 | 2 | 1500 |
| 1305 | 2 | 2 | 1700 |
| 1306 | 1 | 3 | 1500 |
| 1307 | 2 | 1 | 1700 |
| 1308 | 1 | 1 | 1500 |
| 1309 | 4 | 1 | 400 |
| 1310 | 2 | 2 | 1700 |
| 1311 | 1 | 2 | 1500 |
| 1312 | 4 | 1 | 400 |
| 1313 | 1 | 2 | 1500 |
| 1314 | 2 | 3 | 1700 |
| 1315 | 3 | 1 | 800 |
| 1316 | 2 | 4 | 1700 |
| 1317 | 3 | 1 | 800 |
| 1318 | 1 | 1 | 1500 |
| 1319 | 2 | 3 | 1700 |
| 1320 | 1 | 1 | 1500 |
| 1321 | 2 | 2 | 1700 |
| 1322 | 2 | 3 | 1700 |
| 1323 | 3 | 1 | 800 |
| 1324 | 1 | 1 | 1500 |
| 1325 | 1 | 1 | 1500 |
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;