Table
order_line
Products and quantities in an order, with the price charged.
Replaces in 2020: Invoices
Rows 1,976–2,000 of 5,412
| order_id→ purchase_order.order_id | product_id→ product.product_id | quantityINTEGER | unit_price_centsINTEGER |
|---|---|---|---|
| 1976 | 1 | 1 | 1500 |
| 1977 | 3 | 1 | 800 |
| 1978 | 2 | 4 | 1700 |
| 1979 | 1 | 2 | 1500 |
| 1980 | 4 | 1 | 400 |
| 1981 | 2 | 2 | 1700 |
| 1982 | 2 | 2 | 1700 |
| 1983 | 2 | 2 | 1700 |
| 1984 | 3 | 1 | 800 |
| 1985 | 2 | 2 | 1700 |
| 1986 | 1 | 1 | 1500 |
| 1987 | 4 | 1 | 400 |
| 1988 | 1 | 2 | 1500 |
| 1989 | 1 | 3 | 1500 |
| 1990 | 3 | 1 | 800 |
| 1991 | 3 | 1 | 800 |
| 1992 | 1 | 3 | 1500 |
| 1993 | 1 | 1 | 1500 |
| 1994 | 3 | 1 | 800 |
| 1995 | 4 | 1 | 400 |
| 1996 | 2 | 5 | 1700 |
| 1997 | 3 | 1 | 800 |
| 1998 | 1 | 2 | 1500 |
| 1999 | 1 | 3 | 1500 |
| 2000 | 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;