Table
order_line
Products and quantities in an order, with the price charged.
Replaces in 2020: Invoices
Rows 5,151–5,175 of 5,412
| order_id→ purchase_order.order_id | product_id→ product.product_id | quantityINTEGER | unit_price_centsINTEGER |
|---|---|---|---|
| 5151 | 1 | 1 | 1500 |
| 5152 | 2 | 1 | 1700 |
| 5153 | 4 | 1 | 400 |
| 5154 | 1 | 2 | 1500 |
| 5155 | 1 | 2 | 1500 |
| 5156 | 1 | 1 | 1500 |
| 5157 | 3 | 1 | 800 |
| 5158 | 2 | 2 | 1700 |
| 5159 | 3 | 1 | 800 |
| 5160 | 3 | 1 | 800 |
| 5161 | 4 | 1 | 400 |
| 5162 | 4 | 1 | 400 |
| 5163 | 1 | 1 | 1500 |
| 5164 | 1 | 1 | 1500 |
| 5165 | 1 | 2 | 1500 |
| 5166 | 4 | 1 | 400 |
| 5167 | 1 | 1 | 1500 |
| 5168 | 1 | 1 | 1500 |
| 5169 | 1 | 1 | 1500 |
| 5170 | 2 | 1 | 1700 |
| 5171 | 2 | 2 | 1700 |
| 5172 | 1 | 2 | 1500 |
| 5173 | 4 | 1 | 400 |
| 5174 | 1 | 2 | 1500 |
| 5175 | 1 | 3 | 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;