Table
order_line
Products and quantities in an order, with the price charged.
Replaces in 2020: Invoices
Rows 1,326–1,350 of 5,412
| order_id→ purchase_order.order_id | product_id→ product.product_id | quantityINTEGER | unit_price_centsINTEGER |
|---|---|---|---|
| 1326 | 3 | 1 | 800 |
| 1327 | 2 | 3 | 1700 |
| 1328 | 3 | 1 | 800 |
| 1329 | 1 | 4 | 1500 |
| 1330 | 3 | 1 | 800 |
| 1331 | 1 | 1 | 1500 |
| 1332 | 2 | 1 | 1700 |
| 1333 | 3 | 1 | 800 |
| 1334 | 3 | 1 | 800 |
| 1335 | 3 | 1 | 800 |
| 1336 | 2 | 2 | 1700 |
| 1337 | 2 | 1 | 1700 |
| 1338 | 2 | 1 | 1700 |
| 1339 | 1 | 4 | 1500 |
| 1340 | 2 | 5 | 1700 |
| 1341 | 3 | 1 | 800 |
| 1342 | 3 | 1 | 800 |
| 1343 | 4 | 1 | 400 |
| 1344 | 4 | 1 | 400 |
| 1345 | 1 | 3 | 1500 |
| 1346 | 2 | 1 | 1700 |
| 1347 | 4 | 1 | 400 |
| 1348 | 1 | 1 | 1500 |
| 1349 | 4 | 1 | 400 |
| 1350 | 1 | 4 | 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;