
SELECT b.rest_id, b.rest_name, b.food_type, b.favorites, b.address, round(avg(a.REVIEW_SCORE),2) AS score
FROM rest_review AS a
JOIN rest_info AS b ON a.rest_id = b.rest_id
GROUP BY a.rest_id
HAVING b.address LIKE '서울%'
ORDER BY score DESC, b.favorites DESC;
주의할 점: 연산을 적용시킬 rest_review table을 from으로 두고 rest_info를 join해야 한다.
Share article