Table
order_line
Products and quantities in an order, with the price charged.
Replaces in 2020: Invoices
Rows 1,451–1,475 of 5,412
| order_id→ purchase_order.order_id | product_id→ product.product_id | quantityINTEGER | unit_price_centsINTEGER |
|---|---|---|---|
| 1451 | 2 | 2 | 1700 |
| 1452 | 3 | 1 | 800 |
| 1453 | 3 | 1 | 800 |
| 1454 | 3 | 1 | 800 |
| 1455 | 3 | 1 | 800 |
| 1456 | 4 | 1 | 400 |
| 1457 | 3 | 1 | 800 |
| 1458 | 4 | 1 | 400 |
| 1459 | 3 | 1 | 800 |
| 1460 | 1 | 2 | 1500 |
| 1461 | 2 | 1 | 1700 |
| 1462 | 1 | 3 | 1500 |
| 1463 | 1 | 2 | 1500 |
| 1464 | 3 | 1 | 800 |
| 1465 | 4 | 1 | 400 |
| 1466 | 4 | 1 | 400 |
| 1467 | 4 | 1 | 400 |
| 1468 | 1 | 3 | 1500 |
| 1469 | 1 | 2 | 1500 |
| 1470 | 2 | 2 | 1700 |
| 1471 | 1 | 2 | 1500 |
| 1472 | 4 | 1 | 400 |
| 1473 | 4 | 1 | 400 |
| 1474 | 2 | 4 | 1700 |
| 1475 | 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;