Table
order_line
Products and quantities in an order, with the price charged.
Replaces in 2020: Invoices
Rows 176–200 of 5,412
| order_id→ purchase_order.order_id | product_id→ product.product_id | quantityINTEGER | unit_price_centsINTEGER |
|---|---|---|---|
| 176 | 1 | 5 | 1500 |
| 177 | 2 | 2 | 1700 |
| 178 | 1 | 2 | 1500 |
| 179 | 1 | 3 | 1500 |
| 180 | 1 | 59 | 1500 |
| 181 | 3 | 1 | 800 |
| 182 | 3 | 1 | 800 |
| 183 | 2 | 2 | 1700 |
| 184 | 3 | 1 | 800 |
| 185 | 3 | 1 | 800 |
| 186 | 2 | 1 | 1700 |
| 187 | 3 | 1 | 800 |
| 188 | 2 | 2 | 1700 |
| 189 | 2 | 1 | 1700 |
| 190 | 2 | 2 | 1700 |
| 191 | 3 | 1 | 800 |
| 192 | 3 | 1 | 800 |
| 193 | 2 | 4 | 1700 |
| 194 | 4 | 1 | 400 |
| 195 | 3 | 1 | 800 |
| 196 | 1 | 3 | 1500 |
| 197 | 2 | 5 | 1700 |
| 198 | 3 | 1 | 800 |
| 199 | 2 | 2 | 1700 |
| 200 | 1 | 1 | 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;