Table
order_line
Products and quantities in an order, with the price charged.
Replaces in 2020: Invoices
Rows 1,576–1,600 of 5,412
| order_id→ purchase_order.order_id | product_id→ product.product_id | quantityINTEGER | unit_price_centsINTEGER |
|---|---|---|---|
| 1576 | 3 | 1 | 800 |
| 1577 | 3 | 1 | 800 |
| 1578 | 1 | 1 | 1500 |
| 1579 | 2 | 2 | 1700 |
| 1580 | 1 | 1 | 1500 |
| 1581 | 1 | 2 | 1500 |
| 1582 | 1 | 2 | 1500 |
| 1583 | 4 | 1 | 400 |
| 1584 | 2 | 1 | 1700 |
| 1585 | 2 | 1 | 1700 |
| 1586 | 4 | 1 | 400 |
| 1587 | 4 | 1 | 400 |
| 1588 | 2 | 1 | 1700 |
| 1589 | 4 | 1 | 400 |
| 1590 | 3 | 1 | 800 |
| 1591 | 1 | 2 | 1500 |
| 1592 | 1 | 2 | 1500 |
| 1593 | 2 | 1 | 1700 |
| 1594 | 4 | 1 | 400 |
| 1595 | 2 | 3 | 1700 |
| 1596 | 1 | 1 | 1500 |
| 1597 | 2 | 3 | 1700 |
| 1598 | 4 | 1 | 400 |
| 1599 | 3 | 1 | 800 |
| 1600 | 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;