Table
order_line
Products and quantities in an order, with the price charged.
Replaces in 2020: Invoices
Rows 2,551–2,575 of 5,412
| order_id→ purchase_order.order_id | product_id→ product.product_id | quantityINTEGER | unit_price_centsINTEGER |
|---|---|---|---|
| 2551 | 3 | 1 | 800 |
| 2552 | 2 | 2 | 1700 |
| 2553 | 4 | 1 | 400 |
| 2554 | 2 | 2 | 1700 |
| 2555 | 1 | 4 | 1500 |
| 2556 | 4 | 1 | 400 |
| 2557 | 1 | 42 | 1500 |
| 2558 | 4 | 1 | 400 |
| 2559 | 1 | 1 | 1500 |
| 2560 | 3 | 1 | 800 |
| 2561 | 3 | 1 | 800 |
| 2562 | 3 | 1 | 800 |
| 2563 | 4 | 1 | 400 |
| 2564 | 4 | 1 | 400 |
| 2565 | 2 | 2 | 1700 |
| 2566 | 3 | 1 | 800 |
| 2567 | 2 | 5 | 1700 |
| 2568 | 1 | 3 | 1500 |
| 2569 | 1 | 1 | 1500 |
| 2570 | 1 | 1 | 1500 |
| 2571 | 2 | 2 | 1700 |
| 2572 | 1 | 3 | 1500 |
| 2573 | 4 | 1 | 400 |
| 2574 | 1 | 2 | 1500 |
| 2575 | 2 | 2 | 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;