Table
order_line
Products and quantities in an order, with the price charged.
Replaces in 2020: Invoices
Rows 4,626–4,650 of 5,412
| order_id→ purchase_order.order_id | product_id→ product.product_id | quantityINTEGER | unit_price_centsINTEGER |
|---|---|---|---|
| 4626 | 1 | 5 | 1500 |
| 4627 | 1 | 3 | 1500 |
| 4628 | 2 | 4 | 1700 |
| 4629 | 3 | 1 | 800 |
| 4630 | 1 | 3 | 1500 |
| 4631 | 1 | 1 | 1500 |
| 4632 | 4 | 1 | 400 |
| 4633 | 3 | 1 | 800 |
| 4634 | 1 | 2 | 1500 |
| 4635 | 3 | 1 | 800 |
| 4636 | 3 | 1 | 800 |
| 4637 | 1 | 2 | 1500 |
| 4638 | 2 | 2 | 1700 |
| 4639 | 3 | 1 | 800 |
| 4640 | 2 | 2 | 1700 |
| 4641 | 3 | 1 | 800 |
| 4642 | 4 | 1 | 400 |
| 4643 | 1 | 1 | 1500 |
| 4644 | 2 | 1 | 1700 |
| 4645 | 3 | 1 | 800 |
| 4646 | 3 | 1 | 800 |
| 4647 | 4 | 1 | 400 |
| 4648 | 2 | 1 | 1700 |
| 4649 | 4 | 1 | 400 |
| 4650 | 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;