Table
order_line
Products and quantities in an order, with the price charged.
Replaces in 2020: Invoices
Rows 3,826–3,850 of 5,412
| order_id→ purchase_order.order_id | product_id→ product.product_id | quantityINTEGER | unit_price_centsINTEGER |
|---|---|---|---|
| 3826 | 1 | 1 | 1500 |
| 3827 | 2 | 1 | 1700 |
| 3828 | 1 | 52 | 1500 |
| 3829 | 2 | 2 | 1700 |
| 3830 | 1 | 1 | 1500 |
| 3831 | 4 | 1 | 400 |
| 3832 | 1 | 1 | 1500 |
| 3833 | 3 | 1 | 800 |
| 3834 | 3 | 1 | 800 |
| 3835 | 1 | 2 | 1500 |
| 3836 | 4 | 1 | 400 |
| 3837 | 1 | 4 | 1500 |
| 3838 | 1 | 3 | 1500 |
| 3839 | 4 | 1 | 400 |
| 3840 | 1 | 3 | 1500 |
| 3841 | 2 | 1 | 1700 |
| 3842 | 1 | 1 | 1500 |
| 3843 | 2 | 3 | 1700 |
| 3844 | 3 | 1 | 800 |
| 3845 | 3 | 1 | 800 |
| 3846 | 2 | 2 | 1700 |
| 3847 | 3 | 1 | 800 |
| 3848 | 2 | 3 | 1700 |
| 3849 | 1 | 3 | 1500 |
| 3850 | 1 | 4 | 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;