Table
order_line
Products and quantities in an order, with the price charged.
Replaces in 2020: Invoices
Rows 3,276–3,300 of 5,412
| order_id→ purchase_order.order_id | product_id→ product.product_id | quantityINTEGER | unit_price_centsINTEGER |
|---|---|---|---|
| 3276 | 2 | 2 | 1700 |
| 3277 | 3 | 1 | 800 |
| 3278 | 1 | 1 | 1500 |
| 3279 | 4 | 1 | 400 |
| 3280 | 4 | 1 | 400 |
| 3281 | 1 | 2 | 1500 |
| 3282 | 2 | 1 | 1700 |
| 3283 | 2 | 2 | 1700 |
| 3284 | 1 | 4 | 1500 |
| 3285 | 1 | 3 | 1500 |
| 3286 | 1 | 1 | 1500 |
| 3287 | 3 | 1 | 800 |
| 3288 | 1 | 5 | 1500 |
| 3289 | 1 | 2 | 1500 |
| 3290 | 4 | 1 | 400 |
| 3291 | 3 | 1 | 800 |
| 3292 | 3 | 1 | 800 |
| 3293 | 2 | 1 | 1700 |
| 3294 | 3 | 1 | 800 |
| 3295 | 1 | 2 | 1500 |
| 3296 | 1 | 41 | 1500 |
| 3297 | 1 | 2 | 1500 |
| 3298 | 4 | 1 | 400 |
| 3299 | 2 | 1 | 1700 |
| 3300 | 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;