CREATE TABLE finrev_fed_17 (state_code NUMBER, idcensus NUMBER, school_district CLOB, nces_id CLOB, yr_data NUMBER, t_fed_rev NUMBER, c14 NUMBER, c25 NUMBER)
CREATE TABLE ndecoreexcel_math_grade8 (year NUMBER, state CLOB, all_students CLOB, average_scale_score NUMBER)
CREATE TABLE finrev_fed_key_17 (state_code NUMBER, state CLOB)

School with highest ratio of total revenue and average scores
SELECT T1.school_district, MAX(T1.t_fed_rev / T3.average_scale_score) FROM finrev_fed_17 AS T1 JOIN finrev_fed_key_17 AS T2 ON T1.state_code = T2.state_code JOIN ndecoreexcel_math_grade8 AS T3 ON T2.state = T3.state
SELECT "T1"."school_district", MAX("T1"."t_fed_rev" / NULLIF("T3"."average_scale_score", 0)) FROM "finrev_fed_17" "T1" JOIN "finrev_fed_key_17" "T2" ON "T1"."state_code" = "T2"."state_code" JOIN "ndecoreexcel_math_grade8" "T3" ON "T2"."state" = "T3"."state"