Table
order_line
Products and quantities in an order, with the price charged.
Replaces in 2020: Invoices
Rows 4,451–4,475 of 5,412
| order_id→ purchase_order.order_id | product_id→ product.product_id | quantityINTEGER | unit_price_centsINTEGER |
|---|---|---|---|
| 4451 | 1 | 1 | 1500 |
| 4452 | 4 | 1 | 400 |
| 4453 | 1 | 1 | 1500 |
| 4454 | 1 | 1 | 1500 |
| 4455 | 1 | 2 | 1500 |
| 4456 | 3 | 1 | 800 |
| 4457 | 1 | 2 | 1500 |
| 4458 | 1 | 1 | 1500 |
| 4459 | 1 | 1 | 1500 |
| 4460 | 4 | 1 | 400 |
| 4461 | 1 | 2 | 1500 |
| 4462 | 2 | 3 | 1700 |
| 4463 | 3 | 1 | 800 |
| 4464 | 1 | 3 | 1500 |
| 4465 | 2 | 3 | 1700 |
| 4466 | 1 | 2 | 1500 |
| 4467 | 4 | 1 | 400 |
| 4468 | 4 | 1 | 400 |
| 4469 | 4 | 1 | 400 |
| 4470 | 1 | 1 | 1500 |
| 4471 | 1 | 1 | 1500 |
| 4472 | 1 | 1 | 1500 |
| 4473 | 1 | 1 | 1500 |
| 4474 | 2 | 1 | 1700 |
| 4475 | 1 | 2 | 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;