Table
order_line
Products and quantities in an order, with the price charged.
Replaces in 2020: Invoices
Rows 1,351–1,375 of 5,412
| order_id→ purchase_order.order_id | product_id→ product.product_id | quantityINTEGER | unit_price_centsINTEGER |
|---|---|---|---|
| 1351 | 2 | 3 | 1700 |
| 1352 | 3 | 1 | 800 |
| 1353 | 2 | 4 | 1700 |
| 1354 | 3 | 1 | 800 |
| 1355 | 2 | 3 | 1700 |
| 1356 | 2 | 2 | 1700 |
| 1357 | 2 | 2 | 1700 |
| 1358 | 3 | 1 | 800 |
| 1359 | 2 | 2 | 1700 |
| 1360 | 3 | 1 | 800 |
| 1361 | 1 | 1 | 1500 |
| 1362 | 1 | 1 | 1500 |
| 1363 | 1 | 1 | 1500 |
| 1364 | 1 | 1 | 1500 |
| 1365 | 4 | 1 | 400 |
| 1366 | 1 | 1 | 1500 |
| 1367 | 1 | 1 | 1500 |
| 1368 | 1 | 1 | 1500 |
| 1369 | 1 | 1 | 1500 |
| 1370 | 3 | 1 | 800 |
| 1371 | 1 | 1 | 1500 |
| 1372 | 4 | 1 | 400 |
| 1373 | 4 | 1 | 400 |
| 1374 | 1 | 3 | 1500 |
| 1375 | 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;