Table
order_line
Products and quantities in an order, with the price charged.
Replaces in 2020: Invoices
Rows 1,501–1,525 of 5,412
| order_id→ purchase_order.order_id | product_id→ product.product_id | quantityINTEGER | unit_price_centsINTEGER |
|---|---|---|---|
| 1501 | 1 | 5 | 1500 |
| 1502 | 3 | 1 | 800 |
| 1503 | 3 | 1 | 800 |
| 1504 | 2 | 5 | 1700 |
| 1505 | 3 | 1 | 800 |
| 1506 | 3 | 1 | 800 |
| 1507 | 3 | 1 | 800 |
| 1508 | 1 | 1 | 1500 |
| 1509 | 1 | 2 | 1500 |
| 1510 | 1 | 2 | 1500 |
| 1511 | 1 | 4 | 1500 |
| 1512 | 1 | 2 | 1500 |
| 1513 | 2 | 1 | 1700 |
| 1514 | 1 | 2 | 1500 |
| 1515 | 4 | 1 | 400 |
| 1516 | 3 | 1 | 800 |
| 1517 | 2 | 2 | 1700 |
| 1518 | 1 | 2 | 1500 |
| 1519 | 2 | 5 | 1700 |
| 1520 | 3 | 1 | 800 |
| 1521 | 1 | 5 | 1500 |
| 1522 | 3 | 1 | 800 |
| 1523 | 3 | 1 | 800 |
| 1524 | 4 | 1 | 400 |
| 1525 | 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;