Question: Write an SQL query to get the 3 most popular pizzas for each city. The goal is to rank the pizza by the count of

Write an SQL query to get the 3 most popular pizzas for each city.

The goal is to rank the pizza by the count of orders in descending order for each city where orders were made. Pizzas with the same number of orders should be sorted alphabetically in ascending order. For each city, the top 3 pizzas must be selected and concatenated into a final list.

In the final list the pizza names must be delimited by comma and space characters. Items in the list must be sorted alphabetically.

example output:

Write an SQL query to get the 3 most popular pizzas for

each city. The goal is to rank the pizza by the count

city pizza_list Florence Capricciosa, Country, Margarita Las Vegas Capricciosa, Veggie Malm Country, Gourmet, Quattro Formaggi Manaus Pepperoni, Quattro Stagioni, Veggie Selinia Country, Gourmet, Quattro Stagioni

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!