Table
order_line
Products and quantities in an order, with the price charged.
Replaces in 2020: Invoices
Rows 5,101–5,125 of 5,412
| order_id→ purchase_order.order_id | product_id→ product.product_id | quantityINTEGER | unit_price_centsINTEGER |
|---|---|---|---|
| 5101 | 1 | 5 | 1500 |
| 5102 | 1 | 5 | 1500 |
| 5103 | 2 | 4 | 1700 |
| 5104 | 3 | 1 | 800 |
| 5105 | 1 | 2 | 1500 |
| 5106 | 2 | 3 | 1700 |
| 5107 | 4 | 1 | 400 |
| 5108 | 1 | 2 | 1500 |
| 5109 | 1 | 4 | 1500 |
| 5110 | 3 | 1 | 800 |
| 5111 | 1 | 2 | 1500 |
| 5112 | 1 | 2 | 1500 |
| 5113 | 3 | 1 | 800 |
| 5114 | 1 | 1 | 1500 |
| 5115 | 1 | 1 | 1500 |
| 5116 | 2 | 4 | 1700 |
| 5117 | 3 | 1 | 800 |
| 5118 | 3 | 1 | 800 |
| 5119 | 2 | 3 | 1700 |
| 5120 | 4 | 1 | 400 |
| 5121 | 2 | 1 | 1700 |
| 5122 | 1 | 3 | 1500 |
| 5123 | 1 | 2 | 1500 |
| 5124 | 1 | 1 | 1500 |
| 5125 | 1 | 1 | 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;