From d15950e4f0fc1731c5963ef60e8c983427f7e334 Mon Sep 17 00:00:00 2001 From: daviddoji Date: Mon, 27 Apr 2026 17:09:04 +0200 Subject: [PATCH] automated commit by check50 [check50=True] --- 11.sql | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/11.sql b/11.sql index e69de29..013be17 100644 --- a/11.sql +++ b/11.sql @@ -0,0 +1,12 @@ +-- write a SQL query to display the names of schools, their per-pupil expenditure, and their graduation rate. +-- Sort the schools from greatest per-pupil expenditure to least. +-- If two schools have the same per-pupil expenditure, sort by school name. +-- +-- You should assume a school spends the same amount per-pupil their district as a whole spends. +SELECT d."name", e."per_pupil_expenditure", g."graduated" +FROM "expenditures" AS e +JOIN "districts" AS d +ON e."district_id" = d."id" +JOIN "graduation_rates" AS g +ON d."id" = g."id" +ORDER BY e."per_pupil_expenditure" DESC, d."name" ASC;