Table
order_line
Products and quantities in an order, with the price charged.
Replaces in 2020: Invoices
Rows 426–450 of 5,412
| order_id→ purchase_order.order_id | product_id→ product.product_id | quantityINTEGER | unit_price_centsINTEGER |
|---|---|---|---|
| 426 | 1 | 1 | 1500 |
| 427 | 1 | 3 | 1500 |
| 428 | 2 | 2 | 1700 |
| 429 | 2 | 2 | 1700 |
| 430 | 4 | 1 | 400 |
| 431 | 1 | 1 | 1500 |
| 432 | 2 | 1 | 1700 |
| 433 | 2 | 1 | 1700 |
| 434 | 2 | 2 | 1700 |
| 435 | 3 | 1 | 800 |
| 436 | 2 | 2 | 1700 |
| 437 | 2 | 1 | 1700 |
| 438 | 2 | 1 | 1700 |
| 439 | 3 | 1 | 800 |
| 440 | 2 | 1 | 1700 |
| 441 | 2 | 1 | 1700 |
| 442 | 4 | 1 | 400 |
| 443 | 1 | 4 | 1500 |
| 444 | 1 | 5 | 1500 |
| 445 | 2 | 2 | 1700 |
| 446 | 2 | 1 | 1700 |
| 447 | 3 | 1 | 800 |
| 448 | 2 | 2 | 1700 |
| 449 | 3 | 1 | 800 |
| 450 | 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;