Table
order_line
Products and quantities in an order, with the price charged.
Replaces in 2020: Invoices
Rows 5,351–5,375 of 5,412
| order_id→ purchase_order.order_id | product_id→ product.product_id | quantityINTEGER | unit_price_centsINTEGER |
|---|---|---|---|
| 5351 | 2 | 3 | 1700 |
| 5352 | 3 | 1 | 800 |
| 5353 | 3 | 1 | 800 |
| 5354 | 4 | 1 | 400 |
| 5355 | 2 | 3 | 1700 |
| 5356 | 3 | 1 | 800 |
| 5357 | 3 | 1 | 800 |
| 5358 | 1 | 4 | 1500 |
| 5359 | 1 | 1 | 1500 |
| 5360 | 1 | 1 | 1500 |
| 5361 | 2 | 2 | 1700 |
| 5362 | 1 | 2 | 1500 |
| 5363 | 4 | 1 | 400 |
| 5364 | 1 | 2 | 1500 |
| 5365 | 4 | 1 | 400 |
| 5366 | 3 | 1 | 800 |
| 5367 | 1 | 1 | 1500 |
| 5368 | 2 | 2 | 1700 |
| 5369 | 1 | 2 | 1500 |
| 5370 | 1 | 1 | 1500 |
| 5371 | 1 | 1 | 1500 |
| 5372 | 2 | 2 | 1700 |
| 5373 | 1 | 2 | 1500 |
| 5374 | 4 | 1 | 400 |
| 5375 | 1 | 3 | 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;