카테고리 없음

7) 랭크게임 하다가 싸워서 피드백 남겼어요…

news0516 2024. 10. 17. 17:23

lol_feedbacks 테이블


25. lol_feedbacks 테이블에서 만족도 점수(satisfaction_score)에 따라 피드백을 내림차순으로 정렬하는 쿼리를 작성해주세요!
SELECT user_name,
satisfaction_score
FROM lol_feedbacks
order by 2 desc


26. lol_feedbacks 테이블에서 각 유저별로 최신 피드백을 찾는 쿼리를 작성해주세요!
select user_name,
max(feedback_date)
from lol_feedbacks 
group by 1


27. lol_feedbacks 테이블에서 만족도 점수가 5점인 피드백의 수를 계산하는 쿼리를 작성해주세요!
select count(1) as '5score'
from lol_feedbacks
where satisfaction_score = 5


28. lol_feedbacks 테이블에서 가장 많은 피드백을 남긴 상위 3명의 고객을 찾는 쿼리를 작성해주세요!
select user_name,
count(satisfaction_score)
from lol_feedbacks
group by 1
order by 2 DESC


29. lol_feedbacks 테이블에서 평균 만족도 점수가 가장 높은 날짜를 찾는 쿼리를 작성해주세요!
select feedback_date,
AVG(satisfaction_score)
from lol_feedbacks
group by 1
order by 2 DESC