Table
order_line
Products and quantities in an order, with the price charged.
Replaces in 2020: Invoices
Rows 601–625 of 5,412
| order_id→ purchase_order.order_id | product_id→ product.product_id | quantityINTEGER | unit_price_centsINTEGER |
|---|---|---|---|
| 601 | 1 | 2 | 1500 |
| 602 | 2 | 1 | 1700 |
| 603 | 4 | 1 | 400 |
| 604 | 2 | 2 | 1700 |
| 605 | 3 | 1 | 800 |
| 606 | 3 | 1 | 800 |
| 607 | 3 | 1 | 800 |
| 608 | 4 | 1 | 400 |
| 609 | 2 | 1 | 1700 |
| 610 | 3 | 1 | 800 |
| 611 | 3 | 1 | 800 |
| 612 | 2 | 1 | 1700 |
| 613 | 2 | 1 | 1700 |
| 614 | 3 | 1 | 800 |
| 615 | 3 | 1 | 800 |
| 616 | 1 | 2 | 1500 |
| 617 | 2 | 2 | 1700 |
| 618 | 3 | 1 | 800 |
| 619 | 3 | 1 | 800 |
| 620 | 2 | 2 | 1700 |
| 621 | 4 | 1 | 400 |
| 622 | 1 | 4 | 1500 |
| 623 | 2 | 1 | 1700 |
| 624 | 1 | 2 | 1500 |
| 625 | 2 | 3 | 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;