Table
order_line
Products and quantities in an order, with the price charged.
Replaces in 2020: Invoices
Rows 4,301–4,325 of 5,412
| order_id→ purchase_order.order_id | product_id→ product.product_id | quantityINTEGER | unit_price_centsINTEGER |
|---|---|---|---|
| 4301 | 3 | 1 | 800 |
| 4302 | 1 | 5 | 1500 |
| 4303 | 1 | 1 | 1500 |
| 4304 | 1 | 4 | 1500 |
| 4305 | 3 | 1 | 800 |
| 4306 | 1 | 2 | 1500 |
| 4307 | 1 | 4 | 1500 |
| 4308 | 1 | 4 | 1500 |
| 4309 | 2 | 2 | 1700 |
| 4310 | 3 | 1 | 800 |
| 4311 | 2 | 4 | 1700 |
| 4312 | 2 | 1 | 1700 |
| 4313 | 1 | 3 | 1500 |
| 4314 | 4 | 1 | 400 |
| 4315 | 4 | 1 | 400 |
| 4316 | 1 | 1 | 1500 |
| 4317 | 1 | 1 | 1500 |
| 4318 | 4 | 1 | 400 |
| 4319 | 2 | 2 | 1700 |
| 4320 | 3 | 1 | 800 |
| 4321 | 1 | 1 | 1500 |
| 4322 | 2 | 1 | 1700 |
| 4323 | 2 | 1 | 1700 |
| 4324 | 1 | 2 | 1500 |
| 4325 | 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;