-- SELECT
--     repo_name,
--     day,
--     stars
-- FROM
-- (
--     SELECT
--         row_number() OVER (PARTITION BY repo_name ORDER BY stars DESC) AS rank,
--         repo_name,
--         day,
--         stars
--     FROM
--     (
--         SELECT
--             repo_name,
--             to_date(created_at) AS day,
--             count() AS stars
--         FROM github_events
--         WHERE event_type = 'WatchEvent'
--         GROUP BY repo_name, day
--     ) t1
-- ) t2
-- WHERE rank = 1
-- ORDER BY stars DESC
-- LIMIT 50
