Table
order_line
Products and quantities in an order, with the price charged.
Replaces in 2020: Invoices
Rows 2,276–2,300 of 5,412
| order_id→ purchase_order.order_id | product_id→ product.product_id | quantityINTEGER | unit_price_centsINTEGER |
|---|---|---|---|
| 2276 | 2 | 3 | 1700 |
| 2277 | 1 | 2 | 1500 |
| 2278 | 1 | 4 | 1500 |
| 2279 | 3 | 1 | 800 |
| 2280 | 4 | 1 | 400 |
| 2281 | 1 | 2 | 1500 |
| 2282 | 1 | 2 | 1500 |
| 2283 | 1 | 2 | 1500 |
| 2284 | 1 | 2 | 1500 |
| 2285 | 4 | 1 | 400 |
| 2286 | 3 | 1 | 800 |
| 2287 | 4 | 1 | 400 |
| 2288 | 1 | 2 | 1500 |
| 2289 | 2 | 2 | 1700 |
| 2290 | 2 | 2 | 1700 |
| 2291 | 3 | 1 | 800 |
| 2292 | 2 | 3 | 1700 |
| 2293 | 4 | 1 | 400 |
| 2294 | 1 | 2 | 1500 |
| 2295 | 1 | 1 | 1500 |
| 2296 | 1 | 2 | 1500 |
| 2297 | 3 | 1 | 800 |
| 2298 | 4 | 1 | 400 |
| 2299 | 1 | 1 | 1500 |
| 2300 | 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;