5 kyu

SQL Basics: Group By Day

7,549 of 7,550jhoffner

Description:

There is an events table used to track different key activities taken on a website. For this task you need to:

  • find the entries whose name equals "trained"
  • group them by the day the activity happened (the date part of the created_at timestamp) and their description's
  • the 2 aforementioned fields should be returned together with the number of grouped entries in a column called count
  • the result should also be sorted by day

"events" table schema

  • id (bigint)
  • name (text)
  • created_at (timestamp)
  • description (text)

expected result schema

  • day (date)
  • description (text)
  • count (numeric)
SQL
Fundamentals

Stats:

CreatedOct 27, 2016
PublishedOct 27, 2016
Warriors Trained12092
Total Skips2114
Total Code Submissions33621
Total Times Completed7550
SQL Completions7549
Total Stars111
% of votes with a positive feedback rating78% of 905
Total "Very Satisfied" Votes600
Total "Somewhat Satisfied" Votes219
Total "Not Satisfied" Votes86
Total Rank Assessments13
Average Assessed Rank
5 kyu
Highest Assessed Rank
5 kyu
Lowest Assessed Rank
7 kyu
Ad
Contributors
  • jhoffner Avatar
  • Javatlacati Avatar
  • FArekkusu Avatar
Ad