-- 코드를 입력하세요
-- SELECT 식당아아디, 식당이름, 음식종류, 즐겨찾기수, 주소, 리뷰평균점수(소수점 세번째 자리에서 반올림)
-- FROM REST_INFO, REST_REVIEW
-- WHERE 서울
-- ORDER BY 평균점수 DESC, 즐겨찾기수 DESC;
-- 지역이 서울특별시인 식당ID, 식당이름
-- SELECT I.REST_ID, I.REST_NAME
-- FROM REST_INFO I JOIN REST_REVIEW R ON I.REST_ID = R.REST_ID
-- WHERE I.ADDRESS LIKE '서울특별시%'
-- GROUP BY I.REST_ID, I.REST_NAME;
SELECT I.REST_ID, I.REST_NAME, I.FOOD_TYPE, I.FAVORITES, I.ADDRESS
, ROUND(AVG(R.REVIEW_SCORE), 2)
FROM REST_INFO I JOIN REST_REVIEW R ON I.REST_ID = R.REST_ID
WHERE I.ADDRESS LIKE '서울특별시%'
OR I.ADDRESS LIKE '서울시%'
GROUP BY I.REST_ID, I.REST_NAME, I.FOOD_TYPE, I.FAVORITES, I.ADDRESS
ORDER BY ROUND(AVG(R.REVIEW_SCORE), 2) DESC, I.FAVORITES DESC;
문제를 잘 보자!!!!