[SQL 문제풀이] 서울에 위치한 식당 목록 출력하기

Stupefyee's avatar
Nov 15, 2024
[SQL 문제풀이] 서울에 위치한 식당 목록 출력하기
notion image
💡
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

stupefyee