Table
order_line
Products and quantities in an order, with the price charged.
Replaces in 2020: Invoices
Rows 526–550 of 5,412
| order_id→ purchase_order.order_id | product_id→ product.product_id | quantityINTEGER | unit_price_centsINTEGER |
|---|---|---|---|
| 526 | 1 | 1 | 1500 |
| 527 | 1 | 1 | 1500 |
| 528 | 2 | 3 | 1700 |
| 529 | 2 | 3 | 1700 |
| 530 | 3 | 1 | 800 |
| 531 | 2 | 1 | 1700 |
| 532 | 3 | 1 | 800 |
| 533 | 2 | 2 | 1700 |
| 534 | 2 | 1 | 1700 |
| 535 | 3 | 1 | 800 |
| 536 | 2 | 1 | 1700 |
| 537 | 2 | 3 | 1700 |
| 538 | 1 | 4 | 1500 |
| 539 | 2 | 2 | 1700 |
| 540 | 3 | 1 | 800 |
| 541 | 2 | 2 | 1700 |
| 542 | 3 | 1 | 800 |
| 543 | 1 | 1 | 1500 |
| 544 | 1 | 1 | 1500 |
| 545 | 1 | 1 | 1500 |
| 546 | 4 | 1 | 400 |
| 547 | 1 | 1 | 1500 |
| 548 | 1 | 1 | 1500 |
| 549 | 3 | 1 | 800 |
| 550 | 2 | 4 | 1700 |
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;