Table
order_line
Products and quantities in an order, with the price charged.
Replaces in 2020: Invoices
Rows 4,976–5,000 of 5,412
| order_id→ purchase_order.order_id | product_id→ product.product_id | quantityINTEGER | unit_price_centsINTEGER |
|---|---|---|---|
| 4976 | 1 | 1 | 1500 |
| 4977 | 1 | 1 | 1500 |
| 4978 | 1 | 2 | 1500 |
| 4979 | 1 | 1 | 1500 |
| 4980 | 4 | 1 | 400 |
| 4981 | 3 | 1 | 800 |
| 4982 | 1 | 2 | 1500 |
| 4983 | 1 | 2 | 1500 |
| 4984 | 4 | 1 | 400 |
| 4985 | 1 | 2 | 1500 |
| 4986 | 4 | 1 | 400 |
| 4987 | 2 | 1 | 1700 |
| 4988 | 1 | 1 | 1500 |
| 4989 | 4 | 1 | 400 |
| 4990 | 1 | 2 | 1500 |
| 4991 | 4 | 1 | 400 |
| 4992 | 3 | 1 | 800 |
| 4993 | 1 | 1 | 1500 |
| 4994 | 1 | 2 | 1500 |
| 4995 | 3 | 1 | 800 |
| 4996 | 3 | 1 | 800 |
| 4997 | 3 | 1 | 800 |
| 4998 | 4 | 1 | 400 |
| 4999 | 2 | 2 | 1700 |
| 5000 | 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;