Table
order_line
Products and quantities in an order, with the price charged.
Replaces in 2020: Invoices
Rows 3,126–3,150 of 5,412
| order_id→ purchase_order.order_id | product_id→ product.product_id | quantityINTEGER | unit_price_centsINTEGER |
|---|---|---|---|
| 3126 | 1 | 1 | 1500 |
| 3127 | 2 | 2 | 1700 |
| 3128 | 1 | 42 | 1500 |
| 3129 | 4 | 1 | 400 |
| 3130 | 4 | 1 | 400 |
| 3131 | 4 | 1 | 400 |
| 3132 | 4 | 1 | 400 |
| 3133 | 2 | 2 | 1700 |
| 3134 | 3 | 1 | 800 |
| 3135 | 1 | 2 | 1500 |
| 3136 | 1 | 2 | 1500 |
| 3137 | 1 | 2 | 1500 |
| 3138 | 3 | 1 | 800 |
| 3139 | 1 | 2 | 1500 |
| 3140 | 1 | 3 | 1500 |
| 3141 | 3 | 1 | 800 |
| 3142 | 2 | 2 | 1700 |
| 3143 | 2 | 5 | 1700 |
| 3144 | 3 | 1 | 800 |
| 3145 | 3 | 1 | 800 |
| 3146 | 1 | 1 | 1500 |
| 3147 | 2 | 2 | 1700 |
| 3148 | 1 | 2 | 1500 |
| 3149 | 1 | 2 | 1500 |
| 3150 | 1 | 2 | 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;