Table
order_line
Products and quantities in an order, with the price charged.
Replaces in 2020: Invoices
Rows 4,126–4,150 of 5,412
| order_id→ purchase_order.order_id | product_id→ product.product_id | quantityINTEGER | unit_price_centsINTEGER |
|---|---|---|---|
| 4126 | 4 | 1 | 400 |
| 4127 | 2 | 1 | 1700 |
| 4128 | 2 | 2 | 1700 |
| 4129 | 2 | 2 | 1700 |
| 4130 | 1 | 1 | 1500 |
| 4131 | 4 | 1 | 400 |
| 4132 | 4 | 1 | 400 |
| 4133 | 1 | 2 | 1500 |
| 4134 | 1 | 1 | 1500 |
| 4135 | 1 | 52 | 1500 |
| 4136 | 4 | 1 | 400 |
| 4137 | 4 | 1 | 400 |
| 4138 | 1 | 1 | 1500 |
| 4139 | 1 | 3 | 1500 |
| 4140 | 1 | 2 | 1500 |
| 4141 | 4 | 1 | 400 |
| 4142 | 1 | 1 | 1500 |
| 4143 | 1 | 1 | 1500 |
| 4144 | 3 | 1 | 800 |
| 4145 | 4 | 1 | 400 |
| 4146 | 2 | 2 | 1700 |
| 4147 | 1 | 2 | 1500 |
| 4148 | 4 | 1 | 400 |
| 4149 | 4 | 1 | 400 |
| 4150 | 2 | 2 | 1700 |
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;