Table
order_line
Products and quantities in an order, with the price charged.
Replaces in 2020: Invoices
Rows 651–675 of 5,412
| order_id→ purchase_order.order_id | product_id→ product.product_id | quantityINTEGER | unit_price_centsINTEGER |
|---|---|---|---|
| 651 | 3 | 1 | 800 |
| 652 | 2 | 2 | 1700 |
| 653 | 1 | 2 | 1500 |
| 654 | 4 | 1 | 400 |
| 655 | 2 | 1 | 1700 |
| 656 | 3 | 1 | 800 |
| 657 | 2 | 2 | 1700 |
| 658 | 1 | 1 | 1500 |
| 659 | 2 | 2 | 1700 |
| 660 | 3 | 1 | 800 |
| 661 | 2 | 4 | 1700 |
| 662 | 3 | 1 | 800 |
| 663 | 2 | 1 | 1700 |
| 664 | 3 | 1 | 800 |
| 665 | 4 | 1 | 400 |
| 666 | 1 | 1 | 1500 |
| 667 | 3 | 1 | 800 |
| 668 | 4 | 1 | 400 |
| 669 | 1 | 51 | 1500 |
| 670 | 2 | 1 | 1700 |
| 671 | 2 | 1 | 1700 |
| 672 | 4 | 1 | 400 |
| 673 | 2 | 5 | 1700 |
| 674 | 2 | 1 | 1700 |
| 675 | 2 | 2 | 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;