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

Stats:

CreatedOct 20, 2016
PublishedOct 20, 2016
Warriors Trained25600
Total Skips2865
Total Code Submissions68052
Total Times Completed13620
SQL Completions13618
Total Stars235
% of votes with a positive feedback rating87% of 1509
Total "Very Satisfied" Votes1170
Total "Somewhat Satisfied" Votes295
Total "Not Satisfied" Votes44
Total Rank Assessments17
Average Assessed Rank
6 kyu
Highest Assessed Rank
5 kyu
Lowest Assessed Rank
7 kyu
Ad
Contributors
  • matt c Avatar
  • jhoffner Avatar
Ad