SQL interview question: Rows Above the Average

Students Exceeding Average GPA

Academic advisors want to recognize students performing above the school average.

Find all students with a GPA higher than the overall average GPA.

Return student_id, name, and gpa. Order by gpa descending.

Skills: subquery in WHERE clause

Tables

students 25 rows
  • student_id integer PK
  • name text
  • email text
  • grade_level integer
  • gpa real
  • enrollment_date text
student_idnameemailgrade_levelgpaenrollment_date
1Alice Johnson[email protected]123.92024-09-01
2Bob Smith[email protected]123.72024-09-01
3Carol Williams[email protected]123.82024-09-01
About the school sample database

Practice on your iPhone

Query Dojo for iPhone has 85 interview questions, timed mock interviews and a tile builder, so you can write queries without a keyboard.

Get the app

Keep going