Table
order_line
Products and quantities in an order, with the price charged.
Replaces in 2020: Invoices
Rows 4,551–4,575 of 5,412
| order_id→ purchase_order.order_id | product_id→ product.product_id | quantityINTEGER | unit_price_centsINTEGER |
|---|---|---|---|
| 4551 | 3 | 1 | 800 |
| 4552 | 3 | 1 | 800 |
| 4553 | 1 | 1 | 1500 |
| 4554 | 1 | 2 | 1500 |
| 4555 | 3 | 1 | 800 |
| 4556 | 1 | 4 | 1500 |
| 4557 | 4 | 1 | 400 |
| 4558 | 3 | 1 | 800 |
| 4559 | 3 | 1 | 800 |
| 4560 | 3 | 1 | 800 |
| 4561 | 4 | 1 | 400 |
| 4562 | 1 | 2 | 1500 |
| 4563 | 1 | 1 | 1500 |
| 4564 | 2 | 3 | 1700 |
| 4565 | 1 | 2 | 1500 |
| 4566 | 1 | 1 | 1500 |
| 4567 | 4 | 1 | 400 |
| 4568 | 1 | 2 | 1500 |
| 4569 | 2 | 4 | 1700 |
| 4570 | 1 | 2 | 1500 |
| 4571 | 4 | 1 | 400 |
| 4572 | 3 | 1 | 800 |
| 4573 | 1 | 4 | 1500 |
| 4574 | 2 | 3 | 1700 |
| 4575 | 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;