고객별 평균 평점
방금과 비슷하게, 이번에는 고객별 평균 영화 평점을 살펴보겠습니다. 각 고객이 준 평균 평점과 함께, 평점 수와 영화 대여 횟수도 포함한 표를 만들어 보세요. 이 요약 통계는 영화 대여 횟수가 7회 초과인 고객만 대상으로 보고하고, 평균 평점을 기준으로 오름차순 정렬하세요.
이 연습은 강의의 일부입니다
SQL로 하는 데이터 기반 의사결정
연습 안내
renting테이블을customer_id로 그룹화하고,customer_id, 평균 평점, 평점 수, 영화 대여 횟수를 조회하세요.- 영화 대여 횟수가 7회 초과인 고객만 선택하세요.
- 결과 표를 평균 평점 기준으로 오름차순 정렬하세요.
실습형 인터랙티브 연습
이 예제를 이 샘플 코드를 완성하여 풀어보세요.
SELECT ___, -- Report the customer_id
___, -- Report the average rating per customer
___, -- Report the number of ratings per customer
___ -- Report the number of movie rentals per customer
FROM renting
GROUP BY customer_id
___ -- Select only customers with more than 7 movie rentals
ORDER BY ___; -- Order by the average rating in ascending order