Table
order_line
Products and quantities in an order, with the price charged.
Replaces in 2020: Invoices
Rows 3,926–3,950 of 5,412
| order_id→ purchase_order.order_id | product_id→ product.product_id | quantityINTEGER | unit_price_centsINTEGER |
|---|---|---|---|
| 3926 | 1 | 1 | 1500 |
| 3927 | 1 | 2 | 1500 |
| 3928 | 1 | 2 | 1500 |
| 3929 | 4 | 1 | 400 |
| 3930 | 4 | 1 | 400 |
| 3931 | 3 | 1 | 800 |
| 3932 | 2 | 2 | 1700 |
| 3933 | 2 | 2 | 1700 |
| 3934 | 3 | 1 | 800 |
| 3935 | 3 | 1 | 800 |
| 3936 | 2 | 1 | 1700 |
| 3937 | 4 | 1 | 400 |
| 3938 | 4 | 1 | 400 |
| 3939 | 1 | 1 | 1500 |
| 3940 | 4 | 1 | 400 |
| 3941 | 1 | 1 | 1500 |
| 3942 | 1 | 5 | 1500 |
| 3943 | 2 | 2 | 1700 |
| 3944 | 4 | 1 | 400 |
| 3945 | 2 | 4 | 1700 |
| 3946 | 1 | 4 | 1500 |
| 3947 | 2 | 2 | 1700 |
| 3948 | 2 | 4 | 1700 |
| 3949 | 3 | 1 | 800 |
| 3950 | 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;