Table
order_line
Products and quantities in an order, with the price charged.
Replaces in 2020: Invoices
Rows 4,326–4,350 of 5,412
| order_id→ purchase_order.order_id | product_id→ product.product_id | quantityINTEGER | unit_price_centsINTEGER |
|---|---|---|---|
| 4326 | 4 | 1 | 400 |
| 4327 | 4 | 1 | 400 |
| 4328 | 1 | 2 | 1500 |
| 4329 | 2 | 2 | 1700 |
| 4330 | 4 | 1 | 400 |
| 4331 | 1 | 2 | 1500 |
| 4332 | 4 | 1 | 400 |
| 4333 | 2 | 2 | 1700 |
| 4334 | 1 | 1 | 1500 |
| 4335 | 4 | 1 | 400 |
| 4336 | 1 | 2 | 1500 |
| 4337 | 2 | 1 | 1700 |
| 4338 | 1 | 2 | 1500 |
| 4339 | 1 | 2 | 1500 |
| 4340 | 3 | 1 | 800 |
| 4341 | 1 | 2 | 1500 |
| 4342 | 1 | 4 | 1500 |
| 4343 | 1 | 2 | 1500 |
| 4344 | 1 | 2 | 1500 |
| 4345 | 2 | 3 | 1700 |
| 4346 | 3 | 1 | 800 |
| 4347 | 1 | 2 | 1500 |
| 4348 | 4 | 1 | 400 |
| 4349 | 1 | 4 | 1500 |
| 4350 | 2 | 3 | 1700 |
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;