Use SQL to complete the following:
For each type of book, list the type and the average price. There are
several BOOKs in each type.
For example, this is what it should look like:
TYPE AVG(PRICE)
TRA 10.50
SFI 11.25
SCI 5.50
PSY 21.25
POE 16.50
PHI 8.00
MYS 17.20
HOR 12.28
HIS 12.00
FIC 18.50
CMP 10.00
ART 30.25
This is what I was doing in MYSQL but it isn’t working and any
suggestion would be greatly appreciated. I keep getting error messages.
This is definitely not the correct way.
SELECT DISTINCT TYPE
FROM BOOK
WHERE TYPE IN (SELECT AVG(PRICE)
FROM BOOK
;
