Skip to content

Instantly share code, notes, and snippets.

@willf
Last active January 30, 2024 02:53
Show Gist options
  • Save willf/8cce9fa6e681c106ca4f0fae1a466d05 to your computer and use it in GitHub Desktop.
Save willf/8cce9fa6e681c106ca4f0fae1a466d05 to your computer and use it in GitHub Desktop.
New Sacred Harp Leaders, 2023
singer n
Shawn Taylor 49
Abigail Cannon 44
Bridge Hill Kennedy 31
Bill Denney 28
Julia Zaffarano 27
Jessica Bellaire 26
Allison Langston 25
Anne Altringham 24
Dami Osoba 23
Indigo Micciche 22
Emmaleigh Calhoun 21
John Sprackland 20
Anne Caswell 19
Carrie Walker 19
Alice Bean 18
Jaidyn Stump 18
Zena Tucker 18
Thomas Begley 17
Paul Kolenbrander 16
Will Harron 16
Abby Huckaby 15
Brandon Buxton 15
Bunk Beasley 15
J.T. Harechmak 15
Brenda Bowley 14
Eric Gu 14
Larry Bingham 14
Rachel Farber 14
Hanna Flyckt 13
Lily Hammond 13
Maria Neumann-Fraune 13
Rachael Geary 13
Susan Lee 13
David Killingsworth 12
Eleni Melis 12
Hannah Blair 12
Jonas Powell 12
Larry Brasher 12
Laurie Kirkland 12
Lloyd Bricken 12
Margaret Hughes 12
Matthew Leger-Small 12
Michaela Natal 12
Nadia Bolz-Weber 12
Bridge Kennedy 11
Jenna Tompkins 11
Jerry Turlington 11
Maddy Mullany 11
Yuka Oiwa 11
Amber Mann 10
Brenda Armstrong 10
Ian Suchon 10
Irene Gilb 10
Kate Howard 10
Kathryn Flanagan 10
Margaret Hunt 10
Mark Jones 10
Nathan Bowler 10
Nathaniel Brown 10
Rachel Geary 10
Rowan Simms 10
Sam Thomas 10
Tom Evers 10
Vivian Ivey 10
Wendy Sibbison 10
SQL Query
 WITH all_high_counts
    AS (SELECT leaders.name        AS singer,
               Min(minutes.year)   AS year,
               Count(minutes.year) AS n
        FROM   song_leader_joins
               INNER JOIN leaders
                       ON leaders.id = song_leader_joins.leader_id
               INNER JOIN minutes
                       ON minutes.id = song_leader_joins.minutes_id
        GROUP  BY leaders.name,
                  minutes.year
        HAVING Count(minutes.id) >= 10
               AND Count(year) >= 5),
    y2022
    AS (SELECT *
        FROM   all_high_counts
        WHERE  year BETWEEN 2000 AND 2022),
    y2023
    AS (SELECT *
        FROM   all_high_counts
        WHERE  year = 2023)
SELECT singer,
      n
FROM   y2023
WHERE  singer NOT IN (SELECT singer
                   FROM   y2022)
ORDER  BY n DESC;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment