Company: Zomato
Difficulty: medium
Problem Description Write a SQL query to identify all cities that have a strictly higher number of customers than the overall average number of customers per city. For each qualifying city, return the country name, the city name, and the total number of customers. Order the final results by the country name in ascending order, followed by the city name in ascending order. Schema Table: country Column Name Type Description id INT Primary Key country_name VARCHAR(128) Name of the country Table: city Column Name Type Description id INT Primary Key city_name VARCHAR(128) Name of the city postal_code VARCHAR(16) Postal code country_id INT Foreign Key referencing country.id Table: customer Column Name Type Description id INT Primary Key customer_name VARCHAR(255) Name of the customer city_id INT Foreign Key referencing city.id customer_address VARCHAR(255) Address of the customer contact_person VARCHAR(255) Contact person (Nullable) email VARCHAR(128) Customer email phone VARCHAR(128) Custom