https://solvesql.com/problems/daily-revenue/
요일별 매출 총액을 조회하는 문제입니다.
SELECT day, sum(total_bill) revenue_daily
FROM tips
GROUP BY day
having revenue_daily > 1000
ORDER BY revenue_daily DESC
https://solvesql.com/problems/multiple-medalist/
SELECT
name
FROM
athletes A
JOIN records R ON A.id = R.athlete_id
JOIN events E ON E.id = R.event_id
JOIN games G ON G.id = R.game_id
JOIN teams T ON T.id = R.team_id
WHERE
year >= 2000
AND medal is not null
GROUP BY
athlete_id
HAVING
COUNT(distinct team) > 1
ORDER BY name