Table
order_line
Products and quantities in an order, with the price charged.
Replaces in 2020: Invoices
Rows 2,176–2,200 of 5,412
| order_id→ purchase_order.order_id | product_id→ product.product_id | quantityINTEGER | unit_price_centsINTEGER |
|---|---|---|---|
| 2176 | 2 | 2 | 1700 |
| 2177 | 3 | 1 | 800 |
| 2178 | 4 | 1 | 400 |
| 2179 | 2 | 2 | 1700 |
| 2180 | 1 | 3 | 1500 |
| 2181 | 4 | 1 | 400 |
| 2182 | 1 | 2 | 1500 |
| 2183 | 4 | 1 | 400 |
| 2184 | 3 | 1 | 800 |
| 2185 | 1 | 3 | 1500 |
| 2186 | 2 | 4 | 1700 |
| 2187 | 3 | 1 | 800 |
| 2188 | 1 | 3 | 1500 |
| 2189 | 2 | 2 | 1700 |
| 2190 | 2 | 1 | 1700 |
| 2191 | 3 | 1 | 800 |
| 2192 | 2 | 1 | 1700 |
| 2193 | 2 | 1 | 1700 |
| 2194 | 2 | 1 | 1700 |
| 2195 | 3 | 1 | 800 |
| 2196 | 4 | 1 | 400 |
| 2197 | 4 | 1 | 400 |
| 2198 | 4 | 1 | 400 |
| 2199 | 1 | 2 | 1500 |
| 2200 | 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;