Table
order_line
Products and quantities in an order, with the price charged.
Replaces in 2020: Invoices
Rows 4,851–4,875 of 5,412
| order_id→ purchase_order.order_id | product_id→ product.product_id | quantityINTEGER | unit_price_centsINTEGER |
|---|---|---|---|
| 4851 | 1 | 3 | 1500 |
| 4852 | 1 | 2 | 1500 |
| 4853 | 4 | 1 | 400 |
| 4854 | 1 | 1 | 1500 |
| 4855 | 3 | 1 | 800 |
| 4856 | 1 | 4 | 1500 |
| 4857 | 4 | 1 | 400 |
| 4858 | 4 | 1 | 400 |
| 4859 | 1 | 5 | 1500 |
| 4860 | 4 | 1 | 400 |
| 4861 | 1 | 1 | 1500 |
| 4862 | 1 | 47 | 1500 |
| 4863 | 1 | 1 | 1500 |
| 4864 | 1 | 1 | 1500 |
| 4865 | 1 | 1 | 1500 |
| 4866 | 4 | 1 | 400 |
| 4867 | 3 | 1 | 800 |
| 4868 | 1 | 2 | 1500 |
| 4869 | 4 | 1 | 400 |
| 4870 | 4 | 1 | 400 |
| 4871 | 1 | 3 | 1500 |
| 4872 | 2 | 3 | 1700 |
| 4873 | 1 | 50 | 1500 |
| 4874 | 3 | 1 | 800 |
| 4875 | 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;