Table
order_line
Products and quantities in an order, with the price charged.
Replaces in 2020: Invoices
Rows 3,376–3,400 of 5,412
| order_id→ purchase_order.order_id | product_id→ product.product_id | quantityINTEGER | unit_price_centsINTEGER |
|---|---|---|---|
| 3376 | 4 | 1 | 400 |
| 3377 | 2 | 3 | 1700 |
| 3378 | 1 | 2 | 1500 |
| 3379 | 3 | 1 | 800 |
| 3380 | 2 | 2 | 1700 |
| 3381 | 1 | 2 | 1500 |
| 3382 | 1 | 2 | 1500 |
| 3383 | 1 | 2 | 1500 |
| 3384 | 2 | 2 | 1700 |
| 3385 | 2 | 4 | 1700 |
| 3386 | 1 | 46 | 1500 |
| 3387 | 3 | 1 | 800 |
| 3388 | 3 | 1 | 800 |
| 3389 | 2 | 2 | 1700 |
| 3390 | 1 | 2 | 1500 |
| 3391 | 2 | 1 | 1700 |
| 3392 | 4 | 1 | 400 |
| 3393 | 1 | 1 | 1500 |
| 3394 | 2 | 2 | 1700 |
| 3395 | 4 | 1 | 400 |
| 3396 | 3 | 1 | 800 |
| 3397 | 1 | 2 | 1500 |
| 3398 | 1 | 1 | 1500 |
| 3399 | 2 | 3 | 1700 |
| 3400 | 2 | 2 | 1700 |
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;