Table
order_line
Products and quantities in an order, with the price charged.
Replaces in 2020: Invoices
Rows 901–925 of 5,412
| order_id→ purchase_order.order_id | product_id→ product.product_id | quantityINTEGER | unit_price_centsINTEGER |
|---|---|---|---|
| 901 | 1 | 2 | 1500 |
| 902 | 4 | 1 | 400 |
| 903 | 2 | 1 | 1700 |
| 904 | 3 | 1 | 800 |
| 905 | 4 | 1 | 400 |
| 906 | 2 | 5 | 1700 |
| 907 | 1 | 2 | 1500 |
| 908 | 1 | 1 | 1500 |
| 909 | 4 | 1 | 400 |
| 910 | 4 | 1 | 400 |
| 911 | 1 | 1 | 1500 |
| 912 | 4 | 1 | 400 |
| 913 | 2 | 1 | 1700 |
| 914 | 1 | 1 | 1500 |
| 915 | 2 | 4 | 1700 |
| 916 | 2 | 2 | 1700 |
| 917 | 2 | 1 | 1700 |
| 918 | 3 | 1 | 800 |
| 919 | 1 | 5 | 1500 |
| 920 | 2 | 2 | 1700 |
| 921 | 1 | 1 | 1500 |
| 922 | 2 | 1 | 1700 |
| 923 | 4 | 1 | 400 |
| 924 | 2 | 2 | 1700 |
| 925 | 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;