Table
order_line
Products and quantities in an order, with the price charged.
Replaces in 2020: Invoices
Rows 226–250 of 5,412
| order_id→ purchase_order.order_id | product_id→ product.product_id | quantityINTEGER | unit_price_centsINTEGER |
|---|---|---|---|
| 226 | 2 | 3 | 1700 |
| 227 | 1 | 3 | 1500 |
| 228 | 2 | 5 | 1700 |
| 229 | 3 | 1 | 800 |
| 230 | 4 | 1 | 400 |
| 231 | 2 | 1 | 1700 |
| 232 | 2 | 2 | 1700 |
| 233 | 1 | 1 | 1500 |
| 234 | 4 | 1 | 400 |
| 235 | 4 | 1 | 400 |
| 236 | 2 | 2 | 1700 |
| 237 | 3 | 1 | 800 |
| 238 | 3 | 1 | 800 |
| 239 | 2 | 2 | 1700 |
| 240 | 2 | 1 | 1700 |
| 241 | 4 | 1 | 400 |
| 242 | 1 | 2 | 1500 |
| 243 | 2 | 2 | 1700 |
| 244 | 2 | 1 | 1700 |
| 245 | 3 | 1 | 800 |
| 246 | 1 | 47 | 1500 |
| 247 | 1 | 1 | 1500 |
| 248 | 4 | 1 | 400 |
| 249 | 1 | 2 | 1500 |
| 250 | 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;