Table
order_line
Products and quantities in an order, with the price charged.
Replaces in 2020: Invoices
Rows 5,376–5,400 of 5,412
| order_id→ purchase_order.order_id | product_id→ product.product_id | quantityINTEGER | unit_price_centsINTEGER |
|---|---|---|---|
| 5376 | 3 | 1 | 800 |
| 5377 | 3 | 1 | 800 |
| 5378 | 1 | 2 | 1500 |
| 5379 | 4 | 1 | 400 |
| 5380 | 4 | 1 | 400 |
| 5381 | 4 | 1 | 400 |
| 5382 | 1 | 5 | 1500 |
| 5383 | 3 | 1 | 800 |
| 5384 | 1 | 2 | 1500 |
| 5385 | 2 | 1 | 1700 |
| 5386 | 1 | 2 | 1500 |
| 5387 | 1 | 4 | 1500 |
| 5388 | 1 | 1 | 1500 |
| 5389 | 1 | 1 | 1500 |
| 5390 | 2 | 1 | 1700 |
| 5391 | 1 | 2 | 1500 |
| 5392 | 3 | 1 | 800 |
| 5393 | 2 | 3 | 1700 |
| 5394 | 1 | 5 | 1500 |
| 5395 | 3 | 1 | 800 |
| 5396 | 4 | 1 | 400 |
| 5397 | 1 | 4 | 1500 |
| 5398 | 1 | 2 | 1500 |
| 5399 | 1 | 1 | 1500 |
| 5400 | 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;