Table
order_line
Products and quantities in an order, with the price charged.
Replaces in 2020: Invoices
Rows 251–275 of 5,412
| order_id→ purchase_order.order_id | product_id→ product.product_id | quantityINTEGER | unit_price_centsINTEGER |
|---|---|---|---|
| 251 | 3 | 1 | 800 |
| 252 | 2 | 1 | 1700 |
| 253 | 3 | 1 | 800 |
| 254 | 3 | 1 | 800 |
| 255 | 2 | 2 | 1700 |
| 256 | 3 | 1 | 800 |
| 257 | 2 | 1 | 1700 |
| 258 | 2 | 1 | 1700 |
| 259 | 1 | 1 | 1500 |
| 260 | 2 | 2 | 1700 |
| 261 | 1 | 1 | 1500 |
| 262 | 3 | 1 | 800 |
| 263 | 3 | 1 | 800 |
| 264 | 2 | 1 | 1700 |
| 265 | 2 | 3 | 1700 |
| 266 | 4 | 1 | 400 |
| 267 | 1 | 1 | 1500 |
| 268 | 4 | 1 | 400 |
| 269 | 4 | 1 | 400 |
| 270 | 2 | 4 | 1700 |
| 271 | 3 | 1 | 800 |
| 272 | 3 | 1 | 800 |
| 273 | 1 | 2 | 1500 |
| 274 | 2 | 2 | 1700 |
| 275 | 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;