Table
order_line
Products and quantities in an order, with the price charged.
Replaces in 2020: Invoices
Rows 2,951–2,975 of 5,412
| order_id→ purchase_order.order_id | product_id→ product.product_id | quantityINTEGER | unit_price_centsINTEGER |
|---|---|---|---|
| 2951 | 2 | 2 | 1700 |
| 2952 | 2 | 1 | 1700 |
| 2953 | 2 | 2 | 1700 |
| 2954 | 3 | 1 | 800 |
| 2955 | 1 | 1 | 1500 |
| 2956 | 1 | 4 | 1500 |
| 2957 | 1 | 3 | 1500 |
| 2958 | 1 | 4 | 1500 |
| 2959 | 3 | 1 | 800 |
| 2960 | 2 | 1 | 1700 |
| 2961 | 4 | 1 | 400 |
| 2962 | 1 | 1 | 1500 |
| 2963 | 2 | 2 | 1700 |
| 2964 | 4 | 1 | 400 |
| 2965 | 4 | 1 | 400 |
| 2966 | 1 | 2 | 1500 |
| 2967 | 4 | 1 | 400 |
| 2968 | 1 | 1 | 1500 |
| 2969 | 3 | 1 | 800 |
| 2970 | 3 | 1 | 800 |
| 2971 | 4 | 1 | 400 |
| 2972 | 1 | 4 | 1500 |
| 2973 | 1 | 3 | 1500 |
| 2974 | 4 | 1 | 400 |
| 2975 | 4 | 1 | 400 |
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;