Table
order_line
Products and quantities in an order, with the price charged.
Replaces in 2020: Invoices
Rows 1,526–1,550 of 5,412
| order_id→ purchase_order.order_id | product_id→ product.product_id | quantityINTEGER | unit_price_centsINTEGER |
|---|---|---|---|
| 1526 | 1 | 3 | 1500 |
| 1527 | 4 | 1 | 400 |
| 1528 | 1 | 5 | 1500 |
| 1529 | 1 | 2 | 1500 |
| 1530 | 4 | 1 | 400 |
| 1531 | 2 | 2 | 1700 |
| 1532 | 1 | 37 | 1500 |
| 1533 | 1 | 3 | 1500 |
| 1534 | 1 | 2 | 1500 |
| 1535 | 2 | 4 | 1700 |
| 1536 | 2 | 2 | 1700 |
| 1537 | 3 | 1 | 800 |
| 1538 | 1 | 3 | 1500 |
| 1539 | 2 | 2 | 1700 |
| 1540 | 3 | 1 | 800 |
| 1541 | 3 | 1 | 800 |
| 1542 | 3 | 1 | 800 |
| 1543 | 2 | 1 | 1700 |
| 1544 | 1 | 2 | 1500 |
| 1545 | 1 | 2 | 1500 |
| 1546 | 2 | 1 | 1700 |
| 1547 | 2 | 2 | 1700 |
| 1548 | 3 | 1 | 800 |
| 1549 | 1 | 5 | 1500 |
| 1550 | 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;