Table
order_line
Products and quantities in an order, with the price charged.
Replaces in 2020: Invoices
Rows 3,451–3,475 of 5,412
| order_id→ purchase_order.order_id | product_id→ product.product_id | quantityINTEGER | unit_price_centsINTEGER |
|---|---|---|---|
| 3451 | 2 | 2 | 1700 |
| 3452 | 2 | 1 | 1700 |
| 3453 | 2 | 2 | 1700 |
| 3454 | 3 | 1 | 800 |
| 3455 | 1 | 1 | 1500 |
| 3456 | 1 | 3 | 1500 |
| 3457 | 1 | 2 | 1500 |
| 3458 | 1 | 2 | 1500 |
| 3459 | 2 | 1 | 1700 |
| 3460 | 2 | 2 | 1700 |
| 3461 | 2 | 2 | 1700 |
| 3462 | 2 | 2 | 1700 |
| 3463 | 3 | 1 | 800 |
| 3464 | 2 | 1 | 1700 |
| 3465 | 3 | 1 | 800 |
| 3466 | 1 | 2 | 1500 |
| 3467 | 1 | 2 | 1500 |
| 3468 | 1 | 2 | 1500 |
| 3469 | 1 | 2 | 1500 |
| 3470 | 3 | 1 | 800 |
| 3471 | 1 | 5 | 1500 |
| 3472 | 4 | 1 | 400 |
| 3473 | 1 | 3 | 1500 |
| 3474 | 1 | 2 | 1500 |
| 3475 | 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;