Table
order_line
Products and quantities in an order, with the price charged.
Replaces in 2020: Invoices
Rows 4,101–4,125 of 5,412
| order_id→ purchase_order.order_id | product_id→ product.product_id | quantityINTEGER | unit_price_centsINTEGER |
|---|---|---|---|
| 4101 | 1 | 3 | 1500 |
| 4102 | 1 | 1 | 1500 |
| 4103 | 1 | 4 | 1500 |
| 4104 | 2 | 3 | 1700 |
| 4105 | 4 | 1 | 400 |
| 4106 | 1 | 3 | 1500 |
| 4107 | 1 | 1 | 1500 |
| 4108 | 1 | 5 | 1500 |
| 4109 | 1 | 2 | 1500 |
| 4110 | 1 | 4 | 1500 |
| 4111 | 1 | 2 | 1500 |
| 4112 | 2 | 2 | 1700 |
| 4113 | 1 | 1 | 1500 |
| 4114 | 2 | 3 | 1700 |
| 4115 | 3 | 1 | 800 |
| 4116 | 2 | 2 | 1700 |
| 4117 | 2 | 2 | 1700 |
| 4118 | 3 | 1 | 800 |
| 4119 | 1 | 4 | 1500 |
| 4120 | 2 | 1 | 1700 |
| 4121 | 3 | 1 | 800 |
| 4122 | 1 | 1 | 1500 |
| 4123 | 3 | 1 | 800 |
| 4124 | 3 | 1 | 800 |
| 4125 | 1 | 5 | 1500 |
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;