CREATE TABLE CAR ( CAR_MAKE char(20), CAR_COLOR number(2), SALE_STATE_CODE number(2), SALE PRICE number)
SALE_STATE COLOR NUMBER_SOLD ------------ ---------- ---------------------- California Blue 123,456 The problem is that the state_codes and colors are coded to save space.The translation codes follow: Colors: Red = 1 Blue = 2 Green = 3 States: California = 12 Nebraska = 33 North Carolina = 44
Select Sale_state_code, Car_color, Avg(sale_price) From car Group by Sale_state_code, Car_color;