Table
order_line
Products and quantities in an order, with the price charged.
Replaces in 2020: Invoices
Rows 4,901–4,925 of 5,412
| order_id→ purchase_order.order_id | product_id→ product.product_id | quantityINTEGER | unit_price_centsINTEGER |
|---|---|---|---|
| 4901 | 2 | 4 | 1700 |
| 4902 | 3 | 1 | 800 |
| 4903 | 3 | 1 | 800 |
| 4904 | 1 | 3 | 1500 |
| 4905 | 2 | 2 | 1700 |
| 4906 | 3 | 1 | 800 |
| 4907 | 1 | 4 | 1500 |
| 4908 | 1 | 2 | 1500 |
| 4909 | 4 | 1 | 400 |
| 4910 | 1 | 1 | 1500 |
| 4911 | 1 | 1 | 1500 |
| 4912 | 4 | 1 | 400 |
| 4913 | 2 | 2 | 1700 |
| 4914 | 4 | 1 | 400 |
| 4915 | 2 | 2 | 1700 |
| 4916 | 3 | 1 | 800 |
| 4917 | 1 | 1 | 1500 |
| 4918 | 1 | 4 | 1500 |
| 4919 | 1 | 2 | 1500 |
| 4920 | 1 | 3 | 1500 |
| 4921 | 1 | 2 | 1500 |
| 4922 | 4 | 1 | 400 |
| 4923 | 2 | 2 | 1700 |
| 4924 | 1 | 3 | 1500 |
| 4925 | 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;