Table
order_line
Products and quantities in an order, with the price charged.
Replaces in 2020: Invoices
Rows 26–50 of 5,412
| order_id→ purchase_order.order_id | product_id→ product.product_id | quantityINTEGER | unit_price_centsINTEGER |
|---|---|---|---|
| 26 | 3 | 1 | 800 |
| 27 | 2 | 2 | 1700 |
| 28 | 3 | 1 | 800 |
| 29 | 3 | 1 | 800 |
| 30 | 3 | 1 | 800 |
| 31 | 1 | 4 | 1500 |
| 32 | 1 | 1 | 1500 |
| 33 | 1 | 2 | 1500 |
| 34 | 2 | 2 | 1700 |
| 35 | 2 | 1 | 1700 |
| 36 | 4 | 1 | 400 |
| 37 | 4 | 1 | 400 |
| 38 | 2 | 1 | 1700 |
| 39 | 2 | 2 | 1700 |
| 40 | 3 | 1 | 800 |
| 41 | 3 | 1 | 800 |
| 42 | 1 | 1 | 1500 |
| 43 | 4 | 1 | 400 |
| 44 | 1 | 1 | 1500 |
| 45 | 4 | 1 | 400 |
| 46 | 4 | 1 | 400 |
| 47 | 1 | 2 | 1500 |
| 48 | 4 | 1 | 400 |
| 49 | 1 | 2 | 1500 |
| 50 | 4 | 1 | 400 |
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;