Table
order_line
Products and quantities in an order, with the price charged.
Replaces in 2020: Invoices
Rows 76–100 of 5,412
| order_id→ purchase_order.order_id | product_id→ product.product_id | quantityINTEGER | unit_price_centsINTEGER |
|---|---|---|---|
| 76 | 1 | 2 | 1500 |
| 77 | 1 | 1 | 1500 |
| 78 | 2 | 2 | 1700 |
| 79 | 1 | 2 | 1500 |
| 80 | 3 | 1 | 800 |
| 81 | 3 | 1 | 800 |
| 82 | 4 | 1 | 400 |
| 83 | 2 | 1 | 1700 |
| 84 | 1 | 1 | 1500 |
| 85 | 2 | 4 | 1700 |
| 86 | 3 | 1 | 800 |
| 87 | 1 | 2 | 1500 |
| 88 | 1 | 1 | 1500 |
| 89 | 2 | 1 | 1700 |
| 90 | 1 | 2 | 1500 |
| 91 | 1 | 2 | 1500 |
| 92 | 4 | 1 | 400 |
| 93 | 2 | 2 | 1700 |
| 94 | 3 | 1 | 800 |
| 95 | 4 | 1 | 400 |
| 96 | 2 | 3 | 1700 |
| 97 | 4 | 1 | 400 |
| 98 | 1 | 1 | 1500 |
| 99 | 2 | 2 | 1700 |
| 100 | 2 | 4 | 1700 |
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;