Table
order_line
Products and quantities in an order, with the price charged.
Replaces in 2020: Invoices
Rows 3,901–3,925 of 5,412
| order_id→ purchase_order.order_id | product_id→ product.product_id | quantityINTEGER | unit_price_centsINTEGER |
|---|---|---|---|
| 3901 | 2 | 2 | 1700 |
| 3902 | 3 | 1 | 800 |
| 3903 | 1 | 3 | 1500 |
| 3904 | 1 | 5 | 1500 |
| 3905 | 4 | 1 | 400 |
| 3906 | 4 | 1 | 400 |
| 3907 | 2 | 2 | 1700 |
| 3908 | 3 | 1 | 800 |
| 3909 | 2 | 4 | 1700 |
| 3910 | 3 | 1 | 800 |
| 3911 | 1 | 2 | 1500 |
| 3912 | 1 | 1 | 1500 |
| 3913 | 1 | 3 | 1500 |
| 3914 | 1 | 1 | 1500 |
| 3915 | 1 | 1 | 1500 |
| 3916 | 4 | 1 | 400 |
| 3917 | 3 | 1 | 800 |
| 3918 | 1 | 1 | 1500 |
| 3919 | 3 | 1 | 800 |
| 3920 | 1 | 3 | 1500 |
| 3921 | 4 | 1 | 400 |
| 3922 | 1 | 2 | 1500 |
| 3923 | 1 | 2 | 1500 |
| 3924 | 3 | 1 | 800 |
| 3925 | 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;