Answered step by step
Verified Expert Solution
Link Copied!

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:

image text in transcribed

image text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions

Question

1. How can world language curricula tell the story of cultures?

Answered: 1 week ago