Table
order_line
Products and quantities in an order, with the price charged.
Replaces in 2020: Invoices
Rows 2,326–2,350 of 5,412
| order_id→ purchase_order.order_id | product_id→ product.product_id | quantityINTEGER | unit_price_centsINTEGER |
|---|---|---|---|
| 2326 | 1 | 2 | 1500 |
| 2327 | 1 | 2 | 1500 |
| 2328 | 1 | 1 | 1500 |
| 2329 | 1 | 1 | 1500 |
| 2330 | 1 | 2 | 1500 |
| 2331 | 2 | 2 | 1700 |
| 2332 | 1 | 1 | 1500 |
| 2333 | 4 | 1 | 400 |
| 2334 | 2 | 5 | 1700 |
| 2335 | 1 | 1 | 1500 |
| 2336 | 3 | 1 | 800 |
| 2337 | 3 | 1 | 800 |
| 2338 | 3 | 1 | 800 |
| 2339 | 3 | 1 | 800 |
| 2340 | 2 | 1 | 1700 |
| 2341 | 2 | 2 | 1700 |
| 2342 | 4 | 1 | 400 |
| 2343 | 1 | 43 | 1500 |
| 2344 | 1 | 2 | 1500 |
| 2345 | 1 | 2 | 1500 |
| 2346 | 2 | 2 | 1700 |
| 2347 | 1 | 3 | 1500 |
| 2348 | 4 | 1 | 400 |
| 2349 | 1 | 1 | 1500 |
| 2350 | 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;