From 347ed3063fd51128252aeca58e7234dfcc272edd Mon Sep 17 00:00:00 2001 From: daviddoji Date: Thu, 23 Apr 2026 15:49:50 +0200 Subject: [PATCH] automated commit by check50 [check50=True] --- 4.sql | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/4.sql b/4.sql index e69de29..ecd9834 100644 --- a/4.sql +++ b/4.sql @@ -0,0 +1,9 @@ +-- write a SQL query to find the 10 cities with the most public schools. +-- Your query should return the names of the cities and the number of public schools within them, +-- ordered from greatest number of public schools to least. If two cities have the same number of public schools, +-- order them alphabetically. +SELECT "city", COUNT("name") AS "Number of schools" +FROM "schools" +GROUP BY "city" +ORDER BY "Number of schools" DESC, "name" DESC +LIMIT 10;