Distinct users is not the number of events

SQLMedium10 min

Your task

For each event name, return name, events and users: how many times it happened and how many distinct people did it. Order by name.

Tables

app_user
idINTEGERnameTEXTplanTEXTjoined_onTEXT
1Arifree2026-01-02
2Beapro2026-01-02
3Caifree2026-01-15
4Dotpro2026-02-01
5Elifree2026-02-20
event
idINTEGERuser_idINTEGERnameTEXToccurred_onTEXTsession_idTEXT
11signup2026-01-02s1
21view2026-01-02s1
31view2026-01-03s2
42signup2026-01-02s3
52view2026-01-02s3
62purchase2026-01-02s3
More rows not shown