Table
order_line
Products and quantities in an order, with the price charged.
Replaces in 2020: Invoices
Rows 4,526–4,550 of 5,412
| order_id→ purchase_order.order_id | product_id→ product.product_id | quantityINTEGER | unit_price_centsINTEGER |
|---|---|---|---|
| 4526 | 2 | 3 | 1700 |
| 4527 | 1 | 2 | 1500 |
| 4528 | 1 | 5 | 1500 |
| 4529 | 2 | 1 | 1700 |
| 4530 | 3 | 1 | 800 |
| 4531 | 1 | 2 | 1500 |
| 4532 | 1 | 1 | 1500 |
| 4533 | 3 | 1 | 800 |
| 4534 | 1 | 3 | 1500 |
| 4535 | 1 | 5 | 1500 |
| 4536 | 1 | 1 | 1500 |
| 4537 | 2 | 1 | 1700 |
| 4538 | 1 | 1 | 1500 |
| 4539 | 4 | 1 | 400 |
| 4540 | 1 | 1 | 1500 |
| 4541 | 1 | 4 | 1500 |
| 4542 | 1 | 3 | 1500 |
| 4543 | 4 | 1 | 400 |
| 4544 | 1 | 2 | 1500 |
| 4545 | 1 | 2 | 1500 |
| 4546 | 1 | 1 | 1500 |
| 4547 | 1 | 4 | 1500 |
| 4548 | 2 | 4 | 1700 |
| 4549 | 3 | 1 | 800 |
| 4550 | 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;