Table
order_line
Products and quantities in an order, with the price charged.
Replaces in 2020: Invoices
Rows 1,951–1,975 of 5,412
| order_id→ purchase_order.order_id | product_id→ product.product_id | quantityINTEGER | unit_price_centsINTEGER |
|---|---|---|---|
| 1951 | 1 | 1 | 1500 |
| 1952 | 4 | 1 | 400 |
| 1953 | 3 | 1 | 800 |
| 1954 | 1 | 1 | 1500 |
| 1955 | 1 | 2 | 1500 |
| 1956 | 4 | 1 | 400 |
| 1957 | 4 | 1 | 400 |
| 1958 | 1 | 1 | 1500 |
| 1959 | 1 | 4 | 1500 |
| 1960 | 3 | 1 | 800 |
| 1961 | 2 | 2 | 1700 |
| 1962 | 2 | 2 | 1700 |
| 1963 | 2 | 4 | 1700 |
| 1964 | 3 | 1 | 800 |
| 1965 | 1 | 5 | 1500 |
| 1966 | 4 | 1 | 400 |
| 1967 | 1 | 2 | 1500 |
| 1968 | 2 | 4 | 1700 |
| 1969 | 1 | 3 | 1500 |
| 1970 | 1 | 1 | 1500 |
| 1971 | 3 | 1 | 800 |
| 1972 | 1 | 1 | 1500 |
| 1973 | 3 | 1 | 800 |
| 1974 | 2 | 2 | 1700 |
| 1975 | 3 | 1 | 800 |
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;