automated commit by check50 [check50=True]
This commit is contained in:
24
12.sql
24
12.sql
@@ -12,12 +12,22 @@
|
|||||||
-- FROM "table"
|
-- FROM "table"
|
||||||
-- );
|
-- );
|
||||||
|
|
||||||
SELECT d."name", e."per_pupil_expenditure", g."graduated"
|
SELECT
|
||||||
FROM "schools" AS s
|
d."name",
|
||||||
JOIN "districts" AS d
|
e."per_pupil_expenditure",
|
||||||
ON s."district_id" = d."id"
|
s."exemplary"
|
||||||
|
FROM "districts" AS d
|
||||||
JOIN "expenditures" AS e
|
JOIN "expenditures" AS e
|
||||||
ON d."id" = e."district_id"
|
ON d."id" = e."district_id"
|
||||||
JOIN "graduation_rates" AS g
|
JOIN "staff_evaluations" AS s
|
||||||
ON s."id" = g."school_id"
|
ON d."id" = s."district_id"
|
||||||
ORDER BY e."per_pupil_expenditure" DESC, s."name" ASC;
|
WHERE d."type" = 'Public School'
|
||||||
|
AND e."per_pupil_expenditure" > (
|
||||||
|
SELECT AVG("per_pupil_expenditure")
|
||||||
|
FROM "expenditures"
|
||||||
|
)
|
||||||
|
AND s."exemplary" > (
|
||||||
|
SELECT AVG("exemplary")
|
||||||
|
FROM "staff_evaluations"
|
||||||
|
)
|
||||||
|
ORDER BY s."exemplary" DESC, e."per_pupil_expenditure" DESC;
|
||||||
|
|||||||
Reference in New Issue
Block a user