Table
order_line
Products and quantities in an order, with the price charged.
Replaces in 2020: Invoices
Rows 2,576–2,600 of 5,412
| order_id→ purchase_order.order_id | product_id→ product.product_id | quantityINTEGER | unit_price_centsINTEGER |
|---|---|---|---|
| 2576 | 1 | 2 | 1500 |
| 2577 | 2 | 2 | 1700 |
| 2578 | 3 | 1 | 800 |
| 2579 | 4 | 1 | 400 |
| 2580 | 1 | 1 | 1500 |
| 2581 | 3 | 1 | 800 |
| 2582 | 2 | 4 | 1700 |
| 2583 | 4 | 1 | 400 |
| 2584 | 2 | 1 | 1700 |
| 2585 | 2 | 2 | 1700 |
| 2586 | 4 | 1 | 400 |
| 2587 | 2 | 1 | 1700 |
| 2588 | 1 | 2 | 1500 |
| 2589 | 1 | 1 | 1500 |
| 2590 | 2 | 2 | 1700 |
| 2591 | 2 | 4 | 1700 |
| 2592 | 3 | 1 | 800 |
| 2593 | 1 | 3 | 1500 |
| 2594 | 2 | 1 | 1700 |
| 2595 | 3 | 1 | 800 |
| 2596 | 1 | 58 | 1500 |
| 2597 | 3 | 1 | 800 |
| 2598 | 2 | 1 | 1700 |
| 2599 | 3 | 1 | 800 |
| 2600 | 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;