Table
order_line
Products and quantities in an order, with the price charged.
Replaces in 2020: Invoices
Rows 3,976–4,000 of 5,412
| order_id→ purchase_order.order_id | product_id→ product.product_id | quantityINTEGER | unit_price_centsINTEGER |
|---|---|---|---|
| 3976 | 4 | 1 | 400 |
| 3977 | 1 | 1 | 1500 |
| 3978 | 1 | 2 | 1500 |
| 3979 | 3 | 1 | 800 |
| 3980 | 3 | 1 | 800 |
| 3981 | 2 | 1 | 1700 |
| 3982 | 4 | 1 | 400 |
| 3983 | 1 | 1 | 1500 |
| 3984 | 1 | 1 | 1500 |
| 3985 | 3 | 1 | 800 |
| 3986 | 4 | 1 | 400 |
| 3987 | 2 | 2 | 1700 |
| 3988 | 1 | 2 | 1500 |
| 3989 | 3 | 1 | 800 |
| 3990 | 2 | 1 | 1700 |
| 3991 | 4 | 1 | 400 |
| 3992 | 1 | 2 | 1500 |
| 3993 | 1 | 37 | 1500 |
| 3994 | 1 | 1 | 1500 |
| 3995 | 3 | 1 | 800 |
| 3996 | 1 | 2 | 1500 |
| 3997 | 1 | 3 | 1500 |
| 3998 | 2 | 5 | 1700 |
| 3999 | 3 | 1 | 800 |
| 4000 | 3 | 1 | 800 |
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;