Table
order_line
Products and quantities in an order, with the price charged.
Replaces in 2020: Invoices
Rows 3,326–3,350 of 5,412
| order_id→ purchase_order.order_id | product_id→ product.product_id | quantityINTEGER | unit_price_centsINTEGER |
|---|---|---|---|
| 3326 | 2 | 3 | 1700 |
| 3327 | 3 | 1 | 800 |
| 3328 | 1 | 5 | 1500 |
| 3329 | 4 | 1 | 400 |
| 3330 | 1 | 5 | 1500 |
| 3331 | 1 | 1 | 1500 |
| 3332 | 3 | 1 | 800 |
| 3333 | 3 | 1 | 800 |
| 3334 | 2 | 2 | 1700 |
| 3335 | 1 | 1 | 1500 |
| 3336 | 4 | 1 | 400 |
| 3337 | 1 | 1 | 1500 |
| 3338 | 1 | 2 | 1500 |
| 3339 | 2 | 1 | 1700 |
| 3340 | 3 | 1 | 800 |
| 3341 | 1 | 2 | 1500 |
| 3342 | 1 | 2 | 1500 |
| 3343 | 1 | 2 | 1500 |
| 3344 | 1 | 4 | 1500 |
| 3345 | 3 | 1 | 800 |
| 3346 | 2 | 2 | 1700 |
| 3347 | 4 | 1 | 400 |
| 3348 | 2 | 2 | 1700 |
| 3349 | 1 | 2 | 1500 |
| 3350 | 1 | 2 | 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;