Table
order_line
Products and quantities in an order, with the price charged.
Replaces in 2020: Invoices
Rows 1,251–1,275 of 5,412
| order_id→ purchase_order.order_id | product_id→ product.product_id | quantityINTEGER | unit_price_centsINTEGER |
|---|---|---|---|
| 1251 | 4 | 1 | 400 |
| 1252 | 1 | 2 | 1500 |
| 1253 | 3 | 1 | 800 |
| 1254 | 1 | 2 | 1500 |
| 1255 | 2 | 1 | 1700 |
| 1256 | 3 | 1 | 800 |
| 1257 | 2 | 2 | 1700 |
| 1258 | 1 | 1 | 1500 |
| 1259 | 2 | 2 | 1700 |
| 1260 | 3 | 1 | 800 |
| 1261 | 2 | 2 | 1700 |
| 1262 | 3 | 1 | 800 |
| 1263 | 1 | 2 | 1500 |
| 1264 | 3 | 1 | 800 |
| 1265 | 2 | 2 | 1700 |
| 1266 | 3 | 1 | 800 |
| 1267 | 2 | 3 | 1700 |
| 1268 | 1 | 2 | 1500 |
| 1269 | 4 | 1 | 400 |
| 1270 | 1 | 2 | 1500 |
| 1271 | 2 | 2 | 1700 |
| 1272 | 2 | 5 | 1700 |
| 1273 | 2 | 1 | 1700 |
| 1274 | 3 | 1 | 800 |
| 1275 | 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;