Table
order_line
Products and quantities in an order, with the price charged.
Replaces in 2020: Invoices
Rows 1,276–1,300 of 5,412
| order_id→ purchase_order.order_id | product_id→ product.product_id | quantityINTEGER | unit_price_centsINTEGER |
|---|---|---|---|
| 1276 | 1 | 4 | 1500 |
| 1277 | 1 | 3 | 1500 |
| 1278 | 1 | 1 | 1500 |
| 1279 | 1 | 2 | 1500 |
| 1280 | 4 | 1 | 400 |
| 1281 | 1 | 4 | 1500 |
| 1282 | 3 | 1 | 800 |
| 1283 | 2 | 2 | 1700 |
| 1284 | 3 | 1 | 800 |
| 1285 | 1 | 2 | 1500 |
| 1286 | 1 | 1 | 1500 |
| 1287 | 1 | 1 | 1500 |
| 1288 | 2 | 2 | 1700 |
| 1289 | 2 | 2 | 1700 |
| 1290 | 3 | 1 | 800 |
| 1291 | 2 | 2 | 1700 |
| 1292 | 4 | 1 | 400 |
| 1293 | 1 | 5 | 1500 |
| 1294 | 2 | 2 | 1700 |
| 1295 | 3 | 1 | 800 |
| 1296 | 3 | 1 | 800 |
| 1297 | 2 | 1 | 1700 |
| 1298 | 2 | 3 | 1700 |
| 1299 | 3 | 1 | 800 |
| 1300 | 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;