Table
order_line
Products and quantities in an order, with the price charged.
Replaces in 2020: Invoices
Rows 3,301–3,325 of 5,412
| order_id→ purchase_order.order_id | product_id→ product.product_id | quantityINTEGER | unit_price_centsINTEGER |
|---|---|---|---|
| 3301 | 1 | 2 | 1500 |
| 3302 | 1 | 4 | 1500 |
| 3303 | 4 | 1 | 400 |
| 3304 | 1 | 4 | 1500 |
| 3305 | 1 | 1 | 1500 |
| 3306 | 1 | 3 | 1500 |
| 3307 | 2 | 2 | 1700 |
| 3308 | 2 | 1 | 1700 |
| 3309 | 4 | 1 | 400 |
| 3310 | 1 | 2 | 1500 |
| 3311 | 1 | 1 | 1500 |
| 3312 | 1 | 55 | 1500 |
| 3313 | 4 | 1 | 400 |
| 3314 | 3 | 1 | 800 |
| 3315 | 3 | 1 | 800 |
| 3316 | 1 | 1 | 1500 |
| 3317 | 2 | 2 | 1700 |
| 3318 | 1 | 3 | 1500 |
| 3319 | 2 | 1 | 1700 |
| 3320 | 3 | 1 | 800 |
| 3321 | 1 | 1 | 1500 |
| 3322 | 1 | 2 | 1500 |
| 3323 | 1 | 1 | 1500 |
| 3324 | 1 | 2 | 1500 |
| 3325 | 2 | 1 | 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;