Table
order_line
Products and quantities in an order, with the price charged.
Replaces in 2020: Invoices
Rows 451–475 of 5,412
| order_id→ purchase_order.order_id | product_id→ product.product_id | quantityINTEGER | unit_price_centsINTEGER |
|---|---|---|---|
| 451 | 4 | 1 | 400 |
| 452 | 1 | 5 | 1500 |
| 453 | 3 | 1 | 800 |
| 454 | 2 | 1 | 1700 |
| 455 | 3 | 1 | 800 |
| 456 | 2 | 1 | 1700 |
| 457 | 3 | 1 | 800 |
| 458 | 1 | 2 | 1500 |
| 459 | 2 | 4 | 1700 |
| 460 | 3 | 1 | 800 |
| 461 | 1 | 2 | 1500 |
| 462 | 1 | 4 | 1500 |
| 463 | 1 | 2 | 1500 |
| 464 | 1 | 4 | 1500 |
| 465 | 1 | 3 | 1500 |
| 466 | 1 | 4 | 1500 |
| 467 | 4 | 1 | 400 |
| 468 | 3 | 1 | 800 |
| 469 | 1 | 3 | 1500 |
| 470 | 2 | 2 | 1700 |
| 471 | 3 | 1 | 800 |
| 472 | 3 | 1 | 800 |
| 473 | 4 | 1 | 400 |
| 474 | 1 | 2 | 1500 |
| 475 | 2 | 2 | 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;