Table
order_line
Products and quantities in an order, with the price charged.
Replaces in 2020: Invoices
Rows 626–650 of 5,412
| order_id→ purchase_order.order_id | product_id→ product.product_id | quantityINTEGER | unit_price_centsINTEGER |
|---|---|---|---|
| 626 | 3 | 1 | 800 |
| 627 | 3 | 1 | 800 |
| 628 | 3 | 1 | 800 |
| 629 | 2 | 1 | 1700 |
| 630 | 4 | 1 | 400 |
| 631 | 2 | 2 | 1700 |
| 632 | 3 | 1 | 800 |
| 633 | 2 | 2 | 1700 |
| 634 | 1 | 35 | 1500 |
| 635 | 1 | 2 | 1500 |
| 636 | 1 | 2 | 1500 |
| 637 | 1 | 2 | 1500 |
| 638 | 4 | 1 | 400 |
| 639 | 1 | 2 | 1500 |
| 640 | 3 | 1 | 800 |
| 641 | 4 | 1 | 400 |
| 642 | 1 | 41 | 1500 |
| 643 | 2 | 2 | 1700 |
| 644 | 1 | 1 | 1500 |
| 645 | 4 | 1 | 400 |
| 646 | 1 | 1 | 1500 |
| 647 | 1 | 2 | 1500 |
| 648 | 2 | 2 | 1700 |
| 649 | 2 | 2 | 1700 |
| 650 | 2 | 1 | 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;