Table
order_line
Products and quantities in an order, with the price charged.
Replaces in 2020: Invoices
Rows 2,526–2,550 of 5,412
| order_id→ purchase_order.order_id | product_id→ product.product_id | quantityINTEGER | unit_price_centsINTEGER |
|---|---|---|---|
| 2526 | 3 | 1 | 800 |
| 2527 | 1 | 2 | 1500 |
| 2528 | 2 | 3 | 1700 |
| 2529 | 1 | 4 | 1500 |
| 2530 | 4 | 1 | 400 |
| 2531 | 2 | 1 | 1700 |
| 2532 | 2 | 3 | 1700 |
| 2533 | 3 | 1 | 800 |
| 2534 | 3 | 1 | 800 |
| 2535 | 1 | 1 | 1500 |
| 2536 | 1 | 5 | 1500 |
| 2537 | 2 | 3 | 1700 |
| 2538 | 3 | 1 | 800 |
| 2539 | 2 | 1 | 1700 |
| 2540 | 1 | 2 | 1500 |
| 2541 | 3 | 1 | 800 |
| 2542 | 1 | 2 | 1500 |
| 2543 | 2 | 3 | 1700 |
| 2544 | 3 | 1 | 800 |
| 2545 | 2 | 1 | 1700 |
| 2546 | 1 | 2 | 1500 |
| 2547 | 1 | 4 | 1500 |
| 2548 | 1 | 4 | 1500 |
| 2549 | 2 | 5 | 1700 |
| 2550 | 3 | 1 | 800 |
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;