Table
order_line
Products and quantities in an order, with the price charged.
Replaces in 2020: Invoices
Rows 926–950 of 5,412
| order_id→ purchase_order.order_id | product_id→ product.product_id | quantityINTEGER | unit_price_centsINTEGER |
|---|---|---|---|
| 926 | 4 | 1 | 400 |
| 927 | 2 | 1 | 1700 |
| 928 | 2 | 2 | 1700 |
| 929 | 3 | 1 | 800 |
| 930 | 1 | 5 | 1500 |
| 931 | 1 | 2 | 1500 |
| 932 | 4 | 1 | 400 |
| 933 | 1 | 5 | 1500 |
| 934 | 1 | 1 | 1500 |
| 935 | 2 | 1 | 1700 |
| 936 | 3 | 1 | 800 |
| 937 | 1 | 4 | 1500 |
| 938 | 1 | 3 | 1500 |
| 939 | 2 | 2 | 1700 |
| 940 | 3 | 1 | 800 |
| 941 | 3 | 1 | 800 |
| 942 | 1 | 2 | 1500 |
| 943 | 4 | 1 | 400 |
| 944 | 1 | 1 | 1500 |
| 945 | 1 | 46 | 1500 |
| 946 | 4 | 1 | 400 |
| 947 | 4 | 1 | 400 |
| 948 | 2 | 1 | 1700 |
| 949 | 1 | 2 | 1500 |
| 950 | 3 | 1 | 800 |
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;