Table: leaving_cert
Columns: percentage_range
grade
points_for_higher
points_for_ordinary
points_for_foundation

Question: What average points for highers has 0 has points for ordinary, and Ng as the grade, and less than 0 as points for foundation?
SQL: SELECT AVG("points_for_higher") FROM leaving_cert WHERE "points_for_ordinary" = 0 AND "grade" = 'ng' AND "points_for_foundation" < 0

Question: What is the maximum points for higher when the points for foundation is less than 0?
SQL: SELECT MAX("points_for_higher") FROM leaving_cert WHERE "points_for_foundation" < 0

Question: With 10 as the points for foundation, what is the maximum points for ordinary?
SQL: SELECT MAX("points_for_ordinary") FROM leaving_cert WHERE "points_for_foundation" = 10