bot50
2026-04-27 14:45:46 +00:00
commit 2f59c8ad0e
13 changed files with 55 additions and 0 deletions

10
4.sql Normal file
View File

@@ -0,0 +1,10 @@
-- 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(*) AS "Number of schools"
FROM "schools"
WHERE "type" = "Public School"
GROUP BY "city"
ORDER BY "Number of schools" DESC, "city" ASC
LIMIT 10;