Table
order_line
Products and quantities in an order, with the price charged.
Replaces in 2020: Invoices
Rows 4,351–4,375 of 5,412
| order_id→ purchase_order.order_id | product_id→ product.product_id | quantityINTEGER | unit_price_centsINTEGER |
|---|---|---|---|
| 4351 | 1 | 2 | 1500 |
| 4352 | 3 | 1 | 800 |
| 4353 | 3 | 1 | 800 |
| 4354 | 3 | 1 | 800 |
| 4355 | 2 | 1 | 1700 |
| 4356 | 1 | 2 | 1500 |
| 4357 | 4 | 1 | 400 |
| 4358 | 1 | 5 | 1500 |
| 4359 | 3 | 1 | 800 |
| 4360 | 4 | 1 | 400 |
| 4361 | 4 | 1 | 400 |
| 4362 | 2 | 2 | 1700 |
| 4363 | 3 | 1 | 800 |
| 4364 | 1 | 1 | 1500 |
| 4365 | 2 | 2 | 1700 |
| 4366 | 1 | 1 | 1500 |
| 4367 | 1 | 2 | 1500 |
| 4368 | 1 | 1 | 1500 |
| 4369 | 1 | 3 | 1500 |
| 4370 | 4 | 1 | 400 |
| 4371 | 2 | 2 | 1700 |
| 4372 | 1 | 1 | 1500 |
| 4373 | 1 | 1 | 1500 |
| 4374 | 2 | 2 | 1700 |
| 4375 | 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;