Table
order_line
Products and quantities in an order, with the price charged.
Replaces in 2020: Invoices
Rows 4,951–4,975 of 5,412
| order_id→ purchase_order.order_id | product_id→ product.product_id | quantityINTEGER | unit_price_centsINTEGER |
|---|---|---|---|
| 4951 | 1 | 1 | 1500 |
| 4952 | 1 | 1 | 1500 |
| 4953 | 1 | 1 | 1500 |
| 4954 | 3 | 1 | 800 |
| 4955 | 1 | 1 | 1500 |
| 4956 | 4 | 1 | 400 |
| 4957 | 1 | 1 | 1500 |
| 4958 | 1 | 2 | 1500 |
| 4959 | 1 | 1 | 1500 |
| 4960 | 4 | 1 | 400 |
| 4961 | 4 | 1 | 400 |
| 4962 | 1 | 2 | 1500 |
| 4963 | 3 | 1 | 800 |
| 4964 | 1 | 2 | 1500 |
| 4965 | 3 | 1 | 800 |
| 4966 | 3 | 1 | 800 |
| 4967 | 1 | 44 | 1500 |
| 4968 | 2 | 2 | 1700 |
| 4969 | 1 | 4 | 1500 |
| 4970 | 2 | 2 | 1700 |
| 4971 | 3 | 1 | 800 |
| 4972 | 1 | 3 | 1500 |
| 4973 | 1 | 2 | 1500 |
| 4974 | 1 | 50 | 1500 |
| 4975 | 4 | 1 | 400 |
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;