group by9 Easy SQL: Counting and Grouping Given a demographics table in the following format: ** demographics table schema ** id name birthday race you need to return a table that shows a count of each race represented, ordered by the count in descending order as: ** output table schema ** race count Solution: SELECT race, COUNT(id) FROM demographics GROUP BY race ORDER BY count DESC Result: race count American Indian or Alaska Native 2.. 2022. 6. 29. SQL with Street Fighter: Total Wins It's time to assess which of the world's greatest fighters are through to the 6 coveted places in the semi-finals of the Street Fighter World Fighting Championship. Every fight of the year has been recorded and each fighter's wins and losses need to be added up. Each row of the table fighters records, alongside the fighter's name, whether they won (1) or lost (0), as well as the type of move tha.. 2022. 6. 14. SQL Basics: Simple GROUP BY 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 id name age select table schema age [group by] people_count (people count) Solution: SELECT age, COUNT(age) AS people_count FROM people GROUP BY age Result: age people_count 8 10 4 7 1 16 5 8 3 7 0 9 9 13 6 12 2022. 6. 13. 이전 1 2 다음