Table
order_line
Products and quantities in an order, with the price charged.
Replaces in 2020: Invoices
Rows 51–75 of 5,412
| order_id→ purchase_order.order_id | product_id→ product.product_id | quantityINTEGER | unit_price_centsINTEGER |
|---|---|---|---|
| 51 | 1 | 45 | 1500 |
| 52 | 2 | 5 | 1700 |
| 53 | 3 | 1 | 800 |
| 54 | 2 | 1 | 1700 |
| 55 | 2 | 2 | 1700 |
| 56 | 1 | 1 | 1500 |
| 57 | 1 | 4 | 1500 |
| 58 | 1 | 2 | 1500 |
| 59 | 1 | 30 | 1500 |
| 60 | 4 | 1 | 400 |
| 61 | 1 | 1 | 1500 |
| 62 | 4 | 1 | 400 |
| 63 | 1 | 2 | 1500 |
| 64 | 4 | 1 | 400 |
| 65 | 2 | 3 | 1700 |
| 66 | 4 | 1 | 400 |
| 67 | 2 | 2 | 1700 |
| 68 | 3 | 1 | 800 |
| 69 | 2 | 2 | 1700 |
| 70 | 3 | 1 | 800 |
| 71 | 4 | 1 | 400 |
| 72 | 4 | 1 | 400 |
| 73 | 4 | 1 | 400 |
| 74 | 2 | 2 | 1700 |
| 75 | 3 | 1 | 800 |
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;