Table
order_line
Products and quantities in an order, with the price charged.
Replaces in 2020: Invoices
Rows 1,401–1,425 of 5,412
| order_id→ purchase_order.order_id | product_id→ product.product_id | quantityINTEGER | unit_price_centsINTEGER |
|---|---|---|---|
| 1401 | 1 | 2 | 1500 |
| 1402 | 2 | 5 | 1700 |
| 1403 | 3 | 1 | 800 |
| 1404 | 3 | 1 | 800 |
| 1405 | 4 | 1 | 400 |
| 1406 | 1 | 2 | 1500 |
| 1407 | 3 | 1 | 800 |
| 1408 | 2 | 5 | 1700 |
| 1409 | 1 | 3 | 1500 |
| 1410 | 4 | 1 | 400 |
| 1411 | 3 | 1 | 800 |
| 1412 | 3 | 1 | 800 |
| 1413 | 4 | 1 | 400 |
| 1414 | 1 | 1 | 1500 |
| 1415 | 2 | 2 | 1700 |
| 1416 | 3 | 1 | 800 |
| 1417 | 1 | 1 | 1500 |
| 1418 | 1 | 5 | 1500 |
| 1419 | 4 | 1 | 400 |
| 1420 | 2 | 2 | 1700 |
| 1421 | 2 | 2 | 1700 |
| 1422 | 1 | 2 | 1500 |
| 1423 | 4 | 1 | 400 |
| 1424 | 1 | 1 | 1500 |
| 1425 | 2 | 2 | 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;