Table
order_line
Products and quantities in an order, with the price charged.
Replaces in 2020: Invoices
Rows 3,876–3,900 of 5,412
| order_id→ purchase_order.order_id | product_id→ product.product_id | quantityINTEGER | unit_price_centsINTEGER |
|---|---|---|---|
| 3876 | 3 | 1 | 800 |
| 3877 | 2 | 3 | 1700 |
| 3878 | 3 | 1 | 800 |
| 3879 | 2 | 4 | 1700 |
| 3880 | 3 | 1 | 800 |
| 3881 | 4 | 1 | 400 |
| 3882 | 4 | 1 | 400 |
| 3883 | 1 | 1 | 1500 |
| 3884 | 1 | 2 | 1500 |
| 3885 | 1 | 1 | 1500 |
| 3886 | 1 | 1 | 1500 |
| 3887 | 1 | 60 | 1500 |
| 3888 | 1 | 5 | 1500 |
| 3889 | 4 | 1 | 400 |
| 3890 | 2 | 4 | 1700 |
| 3891 | 1 | 4 | 1500 |
| 3892 | 1 | 5 | 1500 |
| 3893 | 1 | 4 | 1500 |
| 3894 | 1 | 2 | 1500 |
| 3895 | 1 | 2 | 1500 |
| 3896 | 2 | 1 | 1700 |
| 3897 | 2 | 4 | 1700 |
| 3898 | 3 | 1 | 800 |
| 3899 | 1 | 2 | 1500 |
| 3900 | 1 | 2 | 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;