Kata SQL

For this challenge you need to create a simple GROUP BY statement, you want to group all the people by their age and count the people who have the same age.

people table schema

select table schema

NOTE: Your solution should use pure SQL. Ruby is used within the test cases to do the actual testing.

Solution:

select age, count(*) as people_count from people group by age;

Link

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store