Table
order_line
Products and quantities in an order, with the price charged.
Replaces in 2020: Invoices
Rows 201–225 of 5,412
| order_id→ purchase_order.order_id | product_id→ product.product_id | quantityINTEGER | unit_price_centsINTEGER |
|---|---|---|---|
| 201 | 2 | 1 | 1700 |
| 202 | 1 | 3 | 1500 |
| 203 | 1 | 5 | 1500 |
| 204 | 3 | 1 | 800 |
| 205 | 1 | 46 | 1500 |
| 206 | 2 | 4 | 1700 |
| 207 | 1 | 2 | 1500 |
| 208 | 1 | 1 | 1500 |
| 209 | 4 | 1 | 400 |
| 210 | 2 | 1 | 1700 |
| 211 | 4 | 1 | 400 |
| 212 | 4 | 1 | 400 |
| 213 | 4 | 1 | 400 |
| 214 | 1 | 1 | 1500 |
| 215 | 2 | 1 | 1700 |
| 216 | 3 | 1 | 800 |
| 217 | 2 | 2 | 1700 |
| 218 | 2 | 1 | 1700 |
| 219 | 2 | 3 | 1700 |
| 220 | 3 | 1 | 800 |
| 221 | 1 | 4 | 1500 |
| 222 | 2 | 1 | 1700 |
| 223 | 1 | 4 | 1500 |
| 224 | 1 | 1 | 1500 |
| 225 | 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;