6 kyu
SQL Basics: Simple JOIN and RANK
13,618 of 13,620matt c
Description:
For this challenge you need to create a simple SELECT statement that will return all columns from the people
table, and join to the sales
table so that you can return the COUNT of all sales and RANK each person by their sale_count.
people table schema
- id
- name
sales table schema
- id
- people_id
- sale
- price
You should return all people fields as well as the sale count as "sale_count" and the rank as "sale_rank".
NOTE: Your solution should use pure SQL. Ruby is used within the test cases to do the actual testing.
SQL
Fundamentals
Similar Kata:
Stats:
Created | Oct 20, 2016 |
Published | Oct 20, 2016 |
Warriors Trained | 25600 |
Total Skips | 2865 |
Total Code Submissions | 68052 |
Total Times Completed | 13620 |
SQL Completions | 13618 |
Total Stars | 235 |
% of votes with a positive feedback rating | 87% of 1509 |
Total "Very Satisfied" Votes | 1170 |
Total "Somewhat Satisfied" Votes | 295 |
Total "Not Satisfied" Votes | 44 |
Total Rank Assessments | 17 |
Average Assessed Rank | 6 kyu |
Highest Assessed Rank | 5 kyu |
Lowest Assessed Rank | 7 kyu |