Table
order_line
Products and quantities in an order, with the price charged.
Replaces in 2020: Invoices
Rows 301–325 of 5,412
| order_id→ purchase_order.order_id | product_id→ product.product_id | quantityINTEGER | unit_price_centsINTEGER |
|---|---|---|---|
| 301 | 2 | 2 | 1700 |
| 302 | 3 | 1 | 800 |
| 303 | 3 | 1 | 800 |
| 304 | 2 | 4 | 1700 |
| 305 | 3 | 1 | 800 |
| 306 | 3 | 1 | 800 |
| 307 | 3 | 1 | 800 |
| 308 | 4 | 1 | 400 |
| 309 | 3 | 1 | 800 |
| 310 | 2 | 4 | 1700 |
| 311 | 1 | 5 | 1500 |
| 312 | 2 | 4 | 1700 |
| 313 | 3 | 1 | 800 |
| 314 | 4 | 1 | 400 |
| 315 | 4 | 1 | 400 |
| 316 | 3 | 1 | 800 |
| 317 | 1 | 3 | 1500 |
| 318 | 2 | 2 | 1700 |
| 319 | 1 | 3 | 1500 |
| 320 | 4 | 1 | 400 |
| 321 | 2 | 2 | 1700 |
| 322 | 4 | 1 | 400 |
| 323 | 3 | 1 | 800 |
| 324 | 2 | 2 | 1700 |
| 325 | 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;