88. Events Per Weekday Name
HardDates & Timestrftimeweekday mappingGROUP BY
strftime('%w', date) gives the weekday as a number 0..6 (0=Sunday). To report human-readable names you map that number to a label with a CASE expression, then GROUP BY it to count events per weekday.
Task: return weekday (the day name: Sunday, Monday, …, Saturday) and cnt (number of events on that weekday). Include only weekdays that have at least one event. Order by the weekday number ('%w') so the week runs Sunday → Saturday.
Output columns, in order: weekday, cnt.
Tables
Loading schema…
Expected outputrows must come back in this order
Computing expected output…
This is the result for the example data above. On Submit your query is graded against this example plus 4 hidden edge cases — 5test cases in all. A sloppy query that only fits the example won't pass.
SQL· SQLite · runs in your browser
⌘/Ctrl+↵ run · ⇧⌘/Ctrl+↵ submit
Run a query to see its output here.