-- SELECT 분류, 가격, 이름
-- FROM FOOD_PRODUCT
-- WHERE 그룹 별 가장 비싼 식품명
-- 가격을 기준으로 내림차순
-- 그룹 별 가장 비싼 식품명 -> 최종적으로 WHERE안에 넣어줄 것
-- SELECT CATEGORY, MAX(PRICE), PRODUCT_NAME
-- FROM FOOD_PRODUCT
-- GROUP BY CATEGORY, PRODUCT_NAME
-- HAVING CATEGORY IN ('과자' , '국' , '김치' , '식용유');
-- SELECT CATEGORY, PRICE, PRODUCT_NAME
-- FROM FOOD_PRODUCT
-- WHERE (PRODUCT_NAME, PRICE) IN
-- ORDER BY PRICE DESC;
SELECT CATEGORY, PRICE, PRODUCT_NAME
FROM FOOD_PRODUCT
WHERE (CATEGORY, PRICE) IN (SELECT CATEGORY, MAX(PRICE)
FROM FOOD_PRODUCT
GROUP BY CATEGORY
HAVING CATEGORY IN ('과자' , '국' , '김치' , '식용유'))
ORDER BY PRICE DESC;