Table
order_line
Products and quantities in an order, with the price charged.
Replaces in 2020: Invoices
Rows 3,776–3,800 of 5,412
| order_id→ purchase_order.order_id | product_id→ product.product_id | quantityINTEGER | unit_price_centsINTEGER |
|---|---|---|---|
| 3776 | 2 | 1 | 1700 |
| 3777 | 3 | 1 | 800 |
| 3778 | 4 | 1 | 400 |
| 3779 | 1 | 1 | 1500 |
| 3780 | 4 | 1 | 400 |
| 3781 | 1 | 2 | 1500 |
| 3782 | 2 | 1 | 1700 |
| 3783 | 3 | 1 | 800 |
| 3784 | 1 | 2 | 1500 |
| 3785 | 1 | 2 | 1500 |
| 3786 | 4 | 1 | 400 |
| 3787 | 4 | 1 | 400 |
| 3788 | 4 | 1 | 400 |
| 3789 | 1 | 2 | 1500 |
| 3790 | 4 | 1 | 400 |
| 3791 | 1 | 1 | 1500 |
| 3792 | 1 | 1 | 1500 |
| 3793 | 4 | 1 | 400 |
| 3794 | 3 | 1 | 800 |
| 3795 | 4 | 1 | 400 |
| 3796 | 2 | 1 | 1700 |
| 3797 | 1 | 1 | 1500 |
| 3798 | 1 | 4 | 1500 |
| 3799 | 4 | 1 | 400 |
| 3800 | 4 | 1 | 400 |
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;