Table
order_line
Products and quantities in an order, with the price charged.
Replaces in 2020: Invoices
Rows 4,076–4,100 of 5,412
| order_id→ purchase_order.order_id | product_id→ product.product_id | quantityINTEGER | unit_price_centsINTEGER |
|---|---|---|---|
| 4076 | 1 | 4 | 1500 |
| 4077 | 4 | 1 | 400 |
| 4078 | 1 | 43 | 1500 |
| 4079 | 1 | 2 | 1500 |
| 4080 | 1 | 2 | 1500 |
| 4081 | 1 | 1 | 1500 |
| 4082 | 2 | 2 | 1700 |
| 4083 | 3 | 1 | 800 |
| 4084 | 1 | 5 | 1500 |
| 4085 | 4 | 1 | 400 |
| 4086 | 3 | 1 | 800 |
| 4087 | 1 | 1 | 1500 |
| 4088 | 2 | 1 | 1700 |
| 4089 | 1 | 1 | 1500 |
| 4090 | 2 | 3 | 1700 |
| 4091 | 1 | 2 | 1500 |
| 4092 | 4 | 1 | 400 |
| 4093 | 1 | 2 | 1500 |
| 4094 | 1 | 2 | 1500 |
| 4095 | 1 | 2 | 1500 |
| 4096 | 4 | 1 | 400 |
| 4097 | 1 | 1 | 1500 |
| 4098 | 4 | 1 | 400 |
| 4099 | 4 | 1 | 400 |
| 4100 | 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;