Table
order_line
Products and quantities in an order, with the price charged.
Replaces in 2020: Invoices
Rows 5,176–5,200 of 5,412
| order_id→ purchase_order.order_id | product_id→ product.product_id | quantityINTEGER | unit_price_centsINTEGER |
|---|---|---|---|
| 5176 | 3 | 1 | 800 |
| 5177 | 1 | 2 | 1500 |
| 5178 | 4 | 1 | 400 |
| 5179 | 1 | 2 | 1500 |
| 5180 | 1 | 2 | 1500 |
| 5181 | 1 | 1 | 1500 |
| 5182 | 4 | 1 | 400 |
| 5183 | 1 | 1 | 1500 |
| 5184 | 4 | 1 | 400 |
| 5185 | 3 | 1 | 800 |
| 5186 | 1 | 4 | 1500 |
| 5187 | 3 | 1 | 800 |
| 5188 | 1 | 1 | 1500 |
| 5189 | 2 | 2 | 1700 |
| 5190 | 1 | 1 | 1500 |
| 5191 | 1 | 1 | 1500 |
| 5192 | 1 | 2 | 1500 |
| 5193 | 1 | 1 | 1500 |
| 5194 | 3 | 1 | 800 |
| 5195 | 1 | 2 | 1500 |
| 5196 | 1 | 2 | 1500 |
| 5197 | 1 | 2 | 1500 |
| 5198 | 1 | 1 | 1500 |
| 5199 | 1 | 1 | 1500 |
| 5200 | 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;