Table
order_line
Products and quantities in an order, with the price charged.
Replaces in 2020: Invoices
Rows 5,251–5,275 of 5,412
| order_id→ purchase_order.order_id | product_id→ product.product_id | quantityINTEGER | unit_price_centsINTEGER |
|---|---|---|---|
| 5251 | 4 | 1 | 400 |
| 5252 | 4 | 1 | 400 |
| 5253 | 2 | 2 | 1700 |
| 5254 | 1 | 1 | 1500 |
| 5255 | 4 | 1 | 400 |
| 5256 | 4 | 1 | 400 |
| 5257 | 3 | 1 | 800 |
| 5258 | 1 | 2 | 1500 |
| 5259 | 4 | 1 | 400 |
| 5260 | 2 | 1 | 1700 |
| 5261 | 3 | 1 | 800 |
| 5262 | 2 | 1 | 1700 |
| 5263 | 1 | 2 | 1500 |
| 5264 | 1 | 2 | 1500 |
| 5265 | 2 | 1 | 1700 |
| 5266 | 1 | 1 | 1500 |
| 5267 | 1 | 2 | 1500 |
| 5268 | 2 | 2 | 1700 |
| 5269 | 2 | 1 | 1700 |
| 5270 | 3 | 1 | 800 |
| 5271 | 3 | 1 | 800 |
| 5272 | 4 | 1 | 400 |
| 5273 | 1 | 3 | 1500 |
| 5274 | 1 | 2 | 1500 |
| 5275 | 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;