Table
order_line
Products and quantities in an order, with the price charged.
Replaces in 2020: Invoices
Rows 326–350 of 5,412
| order_id→ purchase_order.order_id | product_id→ product.product_id | quantityINTEGER | unit_price_centsINTEGER |
|---|---|---|---|
| 326 | 3 | 1 | 800 |
| 327 | 4 | 1 | 400 |
| 328 | 2 | 4 | 1700 |
| 329 | 2 | 1 | 1700 |
| 330 | 2 | 2 | 1700 |
| 331 | 2 | 2 | 1700 |
| 332 | 3 | 1 | 800 |
| 333 | 1 | 5 | 1500 |
| 334 | 2 | 3 | 1700 |
| 335 | 2 | 1 | 1700 |
| 336 | 4 | 1 | 400 |
| 337 | 1 | 3 | 1500 |
| 338 | 1 | 3 | 1500 |
| 339 | 2 | 2 | 1700 |
| 340 | 3 | 1 | 800 |
| 341 | 2 | 1 | 1700 |
| 342 | 3 | 1 | 800 |
| 343 | 3 | 1 | 800 |
| 344 | 4 | 1 | 400 |
| 345 | 2 | 2 | 1700 |
| 346 | 3 | 1 | 800 |
| 347 | 3 | 1 | 800 |
| 348 | 2 | 1 | 1700 |
| 349 | 3 | 1 | 800 |
| 350 | 4 | 1 | 400 |
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;