Table
order_line
Products and quantities in an order, with the price charged.
Replaces in 2020: Invoices
Rows 4,276–4,300 of 5,412
| order_id→ purchase_order.order_id | product_id→ product.product_id | quantityINTEGER | unit_price_centsINTEGER |
|---|---|---|---|
| 4276 | 4 | 1 | 400 |
| 4277 | 2 | 1 | 1700 |
| 4278 | 2 | 1 | 1700 |
| 4279 | 3 | 1 | 800 |
| 4280 | 2 | 2 | 1700 |
| 4281 | 4 | 1 | 400 |
| 4282 | 3 | 1 | 800 |
| 4283 | 3 | 1 | 800 |
| 4284 | 4 | 1 | 400 |
| 4285 | 1 | 2 | 1500 |
| 4286 | 1 | 1 | 1500 |
| 4287 | 1 | 2 | 1500 |
| 4288 | 4 | 1 | 400 |
| 4289 | 1 | 38 | 1500 |
| 4290 | 3 | 1 | 800 |
| 4291 | 2 | 2 | 1700 |
| 4292 | 1 | 1 | 1500 |
| 4293 | 2 | 3 | 1700 |
| 4294 | 2 | 2 | 1700 |
| 4295 | 1 | 2 | 1500 |
| 4296 | 2 | 1 | 1700 |
| 4297 | 1 | 2 | 1500 |
| 4298 | 4 | 1 | 400 |
| 4299 | 2 | 2 | 1700 |
| 4300 | 2 | 1 | 1700 |
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;