185. 서울에 위치한 식당 목록 출력하기

김해준's avatar
Jan 05, 2026
185. 서울에 위치한 식당 목록 출력하기

사용언어 : MySQL

문제
notion image
notion image
notion image
풀이
-- 식당 ID, 식당 이름, 음식 종류, 즐겨찾기수, 주소, 리뷰 평균 점수 -- REST_INFO 테이블 = 식당 ID, 식당 이름, 음식 종류, 조회수, 즐겨찾기수, 주차장 유무, 주소, 전화번호 -- REST_REVIEW 테이블 = 리뷰 ID, 식당 ID, 회원 ID, 점수, 리뷰 텍스트, 리뷰 작성일 select info.REST_ID, info.REST_NAME, info.FOOD_TYPE, info.FAVORITES, info.ADDRESS, round(avg(rv.REVIEW_SCORE),2) as SCORE from REST_INFO info inner join REST_REVIEW rv on info.rest_id = rv.rest_id where substr(info.address,1,2) = '서울' group by info.rest_id order by SCORE desc, info.favorites desc;
notion image
Share article