Table
order_line
Products and quantities in an order, with the price charged.
Replaces in 2020: Invoices
Rows 726–750 of 5,412
| order_id→ purchase_order.order_id | product_id→ product.product_id | quantityINTEGER | unit_price_centsINTEGER |
|---|---|---|---|
| 726 | 3 | 1 | 800 |
| 727 | 4 | 1 | 400 |
| 728 | 1 | 3 | 1500 |
| 729 | 4 | 1 | 400 |
| 730 | 2 | 1 | 1700 |
| 731 | 2 | 4 | 1700 |
| 732 | 1 | 3 | 1500 |
| 733 | 4 | 1 | 400 |
| 734 | 2 | 2 | 1700 |
| 735 | 3 | 1 | 800 |
| 736 | 1 | 3 | 1500 |
| 737 | 2 | 1 | 1700 |
| 738 | 4 | 1 | 400 |
| 739 | 2 | 1 | 1700 |
| 740 | 4 | 1 | 400 |
| 741 | 2 | 4 | 1700 |
| 742 | 1 | 1 | 1500 |
| 743 | 1 | 2 | 1500 |
| 744 | 1 | 2 | 1500 |
| 745 | 4 | 1 | 400 |
| 746 | 2 | 1 | 1700 |
| 747 | 3 | 1 | 800 |
| 748 | 4 | 1 | 400 |
| 749 | 4 | 1 | 400 |
| 750 | 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;