Table
order_line
Products and quantities in an order, with the price charged.
Replaces in 2020: Invoices
Rows 2,426–2,450 of 5,412
| order_id→ purchase_order.order_id | product_id→ product.product_id | quantityINTEGER | unit_price_centsINTEGER |
|---|---|---|---|
| 2426 | 4 | 1 | 400 |
| 2427 | 1 | 1 | 1500 |
| 2428 | 4 | 1 | 400 |
| 2429 | 2 | 2 | 1700 |
| 2430 | 2 | 2 | 1700 |
| 2431 | 4 | 1 | 400 |
| 2432 | 1 | 3 | 1500 |
| 2433 | 1 | 2 | 1500 |
| 2434 | 1 | 2 | 1500 |
| 2435 | 1 | 2 | 1500 |
| 2436 | 4 | 1 | 400 |
| 2437 | 3 | 1 | 800 |
| 2438 | 3 | 1 | 800 |
| 2439 | 1 | 5 | 1500 |
| 2440 | 1 | 1 | 1500 |
| 2441 | 1 | 1 | 1500 |
| 2442 | 2 | 2 | 1700 |
| 2443 | 3 | 1 | 800 |
| 2444 | 1 | 1 | 1500 |
| 2445 | 3 | 1 | 800 |
| 2446 | 1 | 2 | 1500 |
| 2447 | 3 | 1 | 800 |
| 2448 | 2 | 1 | 1700 |
| 2449 | 3 | 1 | 800 |
| 2450 | 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;