Table
order_line
Products and quantities in an order, with the price charged.
Replaces in 2020: Invoices
Rows 2,451–2,475 of 5,412
| order_id→ purchase_order.order_id | product_id→ product.product_id | quantityINTEGER | unit_price_centsINTEGER |
|---|---|---|---|
| 2451 | 2 | 1 | 1700 |
| 2452 | 2 | 1 | 1700 |
| 2453 | 2 | 4 | 1700 |
| 2454 | 3 | 1 | 800 |
| 2455 | 1 | 1 | 1500 |
| 2456 | 1 | 2 | 1500 |
| 2457 | 4 | 1 | 400 |
| 2458 | 4 | 1 | 400 |
| 2459 | 1 | 1 | 1500 |
| 2460 | 2 | 2 | 1700 |
| 2461 | 1 | 4 | 1500 |
| 2462 | 2 | 1 | 1700 |
| 2463 | 3 | 1 | 800 |
| 2464 | 1 | 2 | 1500 |
| 2465 | 4 | 1 | 400 |
| 2466 | 2 | 4 | 1700 |
| 2467 | 3 | 1 | 800 |
| 2468 | 2 | 1 | 1700 |
| 2469 | 1 | 1 | 1500 |
| 2470 | 1 | 2 | 1500 |
| 2471 | 4 | 1 | 400 |
| 2472 | 1 | 2 | 1500 |
| 2473 | 1 | 2 | 1500 |
| 2474 | 2 | 2 | 1700 |
| 2475 | 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;