Table
order_line
Products and quantities in an order, with the price charged.
Replaces in 2020: Invoices
Rows 4,926–4,950 of 5,412
| order_id→ purchase_order.order_id | product_id→ product.product_id | quantityINTEGER | unit_price_centsINTEGER |
|---|---|---|---|
| 4926 | 1 | 2 | 1500 |
| 4927 | 1 | 2 | 1500 |
| 4928 | 2 | 2 | 1700 |
| 4929 | 1 | 1 | 1500 |
| 4930 | 3 | 1 | 800 |
| 4931 | 1 | 2 | 1500 |
| 4932 | 1 | 5 | 1500 |
| 4933 | 3 | 1 | 800 |
| 4934 | 3 | 1 | 800 |
| 4935 | 1 | 2 | 1500 |
| 4936 | 1 | 2 | 1500 |
| 4937 | 1 | 4 | 1500 |
| 4938 | 1 | 2 | 1500 |
| 4939 | 4 | 1 | 400 |
| 4940 | 2 | 1 | 1700 |
| 4941 | 1 | 1 | 1500 |
| 4942 | 1 | 2 | 1500 |
| 4943 | 1 | 2 | 1500 |
| 4944 | 3 | 1 | 800 |
| 4945 | 3 | 1 | 800 |
| 4946 | 1 | 2 | 1500 |
| 4947 | 4 | 1 | 400 |
| 4948 | 1 | 1 | 1500 |
| 4949 | 4 | 1 | 400 |
| 4950 | 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;