cypherNEAR - 9. Developer Activity - n commits distribution
    Updated 2023-10-16
    with commits as (select
    author,
    count(*) as n_commits
    from near.beta.github_activity
    where author not in ('dependabot', 'dependabot-preview')
    group by author),

    counts as (select
    count(case when n_commits >= 1 and n_commits <= 5 then 1 end) as "a. 1-5 commits",
    count(case when n_commits > 5 and n_commits <= 10 then 1 end) as "b. 5-10 commits",
    count(case when n_commits > 10 and n_commits <= 50 then 1 end) as "c. 10-50 commits",
    count(case when n_commits > 50 and n_commits <= 100 then 1 end) as "d. 50-100 commits",
    count(case when n_commits > 100 and n_commits <= 200 then 1 end) as "e. 100-200 commits",
    count(case when n_commits > 200 and n_commits <= 300 then 1 end) as "f. 200-300 commits",
    count(case when n_commits > 300 and n_commits <= 400 then 1 end) as "g. 300-400 commits",
    count(case when n_commits > 400 and n_commits <= 500 then 1 end) as "h. 400-500 commits",
    count(case when n_commits > 500 and n_commits <= 600 then 1 end) as "i. 500-600 commits",
    count(case when n_commits > 600 and n_commits <= 700 then 1 end) as "j. 600-700 commits",
    count(case when n_commits > 700 and n_commits <= 800 then 1 end) as "k. 700-800 commits",
    count(case when n_commits > 800 and n_commits <= 900 then 1 end) as "l. 800-900 commits",
    count(case when n_commits > 900 and n_commits <= 1000 then 1 end) as "m. 900-1000 commits",
    count(case when n_commits > 1000 then 1 end) as "o. 1000+ commits"
    from commits)

    select bin, n
    from counts
    unpivot(
    n
    for bin in (
    "a. 1-5 commits",
    "b. 5-10 commits",
    "c. 10-50 commits",
    "d. 50-100 commits",
    "e. 100-200 commits",
    "f. 200-300 commits",
    "g. 300-400 commits",
    Run a query to Download Data