Table
order_line
Products and quantities in an order, with the price charged.
Replaces in 2020: Invoices
Rows 5,076–5,100 of 5,412
| order_id→ purchase_order.order_id | product_id→ product.product_id | quantityINTEGER | unit_price_centsINTEGER |
|---|---|---|---|
| 5076 | 3 | 1 | 800 |
| 5077 | 3 | 1 | 800 |
| 5078 | 4 | 1 | 400 |
| 5079 | 2 | 2 | 1700 |
| 5080 | 1 | 2 | 1500 |
| 5081 | 2 | 2 | 1700 |
| 5082 | 3 | 1 | 800 |
| 5083 | 3 | 1 | 800 |
| 5084 | 1 | 2 | 1500 |
| 5085 | 1 | 1 | 1500 |
| 5086 | 3 | 1 | 800 |
| 5087 | 4 | 1 | 400 |
| 5088 | 1 | 2 | 1500 |
| 5089 | 3 | 1 | 800 |
| 5090 | 1 | 2 | 1500 |
| 5091 | 1 | 2 | 1500 |
| 5092 | 2 | 4 | 1700 |
| 5093 | 1 | 1 | 1500 |
| 5094 | 1 | 2 | 1500 |
| 5095 | 1 | 2 | 1500 |
| 5096 | 1 | 4 | 1500 |
| 5097 | 1 | 5 | 1500 |
| 5098 | 4 | 1 | 400 |
| 5099 | 4 | 1 | 400 |
| 5100 | 1 | 1 | 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;