Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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:
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 StagioniStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started