Table
order_line
Products and quantities in an order, with the price charged.
Replaces in 2020: Invoices
Rows 2,651–2,675 of 5,412
| order_id→ purchase_order.order_id | product_id→ product.product_id | quantityINTEGER | unit_price_centsINTEGER |
|---|---|---|---|
| 2651 | 1 | 3 | 1500 |
| 2652 | 2 | 1 | 1700 |
| 2653 | 1 | 2 | 1500 |
| 2654 | 1 | 2 | 1500 |
| 2655 | 3 | 1 | 800 |
| 2656 | 3 | 1 | 800 |
| 2657 | 1 | 3 | 1500 |
| 2658 | 1 | 2 | 1500 |
| 2659 | 1 | 3 | 1500 |
| 2660 | 1 | 1 | 1500 |
| 2661 | 2 | 4 | 1700 |
| 2662 | 2 | 3 | 1700 |
| 2663 | 1 | 2 | 1500 |
| 2664 | 3 | 1 | 800 |
| 2665 | 4 | 1 | 400 |
| 2666 | 4 | 1 | 400 |
| 2667 | 4 | 1 | 400 |
| 2668 | 4 | 1 | 400 |
| 2669 | 3 | 1 | 800 |
| 2670 | 4 | 1 | 400 |
| 2671 | 1 | 2 | 1500 |
| 2672 | 1 | 2 | 1500 |
| 2673 | 4 | 1 | 400 |
| 2674 | 4 | 1 | 400 |
| 2675 | 1 | 1 | 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;