Table
order_line
Products and quantities in an order, with the price charged.
Replaces in 2020: Invoices
Rows 1,601–1,625 of 5,412
| order_id→ purchase_order.order_id | product_id→ product.product_id | quantityINTEGER | unit_price_centsINTEGER |
|---|---|---|---|
| 1601 | 1 | 1 | 1500 |
| 1602 | 3 | 1 | 800 |
| 1603 | 2 | 2 | 1700 |
| 1604 | 1 | 1 | 1500 |
| 1605 | 1 | 2 | 1500 |
| 1606 | 2 | 3 | 1700 |
| 1607 | 3 | 1 | 800 |
| 1608 | 2 | 4 | 1700 |
| 1609 | 3 | 1 | 800 |
| 1610 | 1 | 1 | 1500 |
| 1611 | 2 | 5 | 1700 |
| 1612 | 3 | 1 | 800 |
| 1613 | 3 | 1 | 800 |
| 1614 | 1 | 2 | 1500 |
| 1615 | 1 | 3 | 1500 |
| 1616 | 2 | 1 | 1700 |
| 1617 | 3 | 1 | 800 |
| 1618 | 1 | 2 | 1500 |
| 1619 | 1 | 1 | 1500 |
| 1620 | 4 | 1 | 400 |
| 1621 | 3 | 1 | 800 |
| 1622 | 3 | 1 | 800 |
| 1623 | 1 | 1 | 1500 |
| 1624 | 1 | 2 | 1500 |
| 1625 | 1 | 4 | 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;