What is the average GPA of all students?
select avg(stu_gpa) from student
How about the average GPA of students in each department?
select dept_code, avg(stu_gpa) from student group by dept_code
Also, find the corresponding name of each department?
select t2.dept_name, avg(t1.stu_gpa) from student as t1 join department as t2 on t1.dept_code = t2.dept_code group by t1.dept_code
Which one has the highest average GPA?
select t2.dept_name, avg(t1.stu_gpa) from student as t1 join department as t2 on t1.dept_code = t2.dept_code group by t1.dept_code order by avg(t1.stu_gpa) desc limit 1