Table
order_line
Products and quantities in an order, with the price charged.
Replaces in 2020: Invoices
Rows 1,476–1,500 of 5,412
| order_id→ purchase_order.order_id | product_id→ product.product_id | quantityINTEGER | unit_price_centsINTEGER |
|---|---|---|---|
| 1476 | 2 | 1 | 1700 |
| 1477 | 1 | 3 | 1500 |
| 1478 | 3 | 1 | 800 |
| 1479 | 2 | 4 | 1700 |
| 1480 | 3 | 1 | 800 |
| 1481 | 1 | 1 | 1500 |
| 1482 | 2 | 2 | 1700 |
| 1483 | 3 | 1 | 800 |
| 1484 | 4 | 1 | 400 |
| 1485 | 4 | 1 | 400 |
| 1486 | 2 | 3 | 1700 |
| 1487 | 2 | 1 | 1700 |
| 1488 | 3 | 1 | 800 |
| 1489 | 2 | 2 | 1700 |
| 1490 | 2 | 5 | 1700 |
| 1491 | 3 | 1 | 800 |
| 1492 | 1 | 4 | 1500 |
| 1493 | 1 | 1 | 1500 |
| 1494 | 2 | 2 | 1700 |
| 1495 | 3 | 1 | 800 |
| 1496 | 1 | 3 | 1500 |
| 1497 | 3 | 1 | 800 |
| 1498 | 2 | 5 | 1700 |
| 1499 | 2 | 4 | 1700 |
| 1500 | 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;