Table
order_line
Products and quantities in an order, with the price charged.
Replaces in 2020: Invoices
Rows 4,251–4,275 of 5,412
| order_id→ purchase_order.order_id | product_id→ product.product_id | quantityINTEGER | unit_price_centsINTEGER |
|---|---|---|---|
| 4251 | 4 | 1 | 400 |
| 4252 | 3 | 1 | 800 |
| 4253 | 1 | 2 | 1500 |
| 4254 | 2 | 4 | 1700 |
| 4255 | 4 | 1 | 400 |
| 4256 | 2 | 2 | 1700 |
| 4257 | 3 | 1 | 800 |
| 4258 | 4 | 1 | 400 |
| 4259 | 1 | 4 | 1500 |
| 4260 | 3 | 1 | 800 |
| 4261 | 4 | 1 | 400 |
| 4262 | 1 | 2 | 1500 |
| 4263 | 1 | 41 | 1500 |
| 4264 | 1 | 2 | 1500 |
| 4265 | 1 | 3 | 1500 |
| 4266 | 3 | 1 | 800 |
| 4267 | 4 | 1 | 400 |
| 4268 | 4 | 1 | 400 |
| 4269 | 3 | 1 | 800 |
| 4270 | 1 | 1 | 1500 |
| 4271 | 1 | 1 | 1500 |
| 4272 | 1 | 3 | 1500 |
| 4273 | 4 | 1 | 400 |
| 4274 | 1 | 3 | 1500 |
| 4275 | 1 | 2 | 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;