7 kyu

GROCERY STORE: Logistic Optimisation

6,166 of 6,165baaart

Description:

You are the owner of the Grocery Store. All your products are in the database, that you have created after CodeWars SQL excercises!:)

You have reached a conclusion that you waste to much time because you have to many different warehouse to visit each week.

You have to find out how many different type of products you buy from each producer. If you take only few items from some of them you will stop going there to save the gasoline:)

In the results show producer and count_products_types which you buy from him.

Order the result by count_products_types (DESC) then by producer (ASC) in case there are duplicate amounts,

products table schema

  • id
  • name
  • price
  • stock
  • producer

results table schema

  • count_products_types
  • producer

Note: there has been a critical change in the description and the column names long after the approval/publication of the kata so don't be surprised if you see solutions with different column names once you solved the kata (solutions weren't revalidated after the change because their was already too much of them).

SQL
Databases
Fundamentals

Stats:

CreatedFeb 22, 2018
PublishedFeb 22, 2018
Warriors Trained9029
Total Skips736
Total Code Submissions22888
Total Times Completed6165
SQL Completions6166
Total Stars48
% of votes with a positive feedback rating72% of 738
Total "Very Satisfied" Votes445
Total "Somewhat Satisfied" Votes170
Total "Not Satisfied" Votes123
Total Rank Assessments4
Average Assessed Rank
7 kyu
Highest Assessed Rank
7 kyu
Lowest Assessed Rank
8 kyu
Ad
Contributors
  • baaart Avatar
  • smile67 Avatar
  • Blind4Basics Avatar
Ad