在 jennifer widom 的 dbclass 中,她举了一个例子,让一所大学与他们申请者的最高 gpa 配对.. sql 如下
select college.cname, state, gpa
from college, apply, student
where college.cname = apply.cname
and apply.sid = student.sid
and gpa >= all (select gpa
from student,apply
where student.sid = apply.sid
and apply.cname = college.cname);
我想知道如何创建查询以查找与申请人的最低gpa配对的大学
我知道这可以按如下方式完成
select college.cname, state, gpa
from college, apply, student
where college.cname = apply.cname
and apply.sid = student.sid
and gpa = (select min(gpa) from student);
但是我该怎么做,而不使用 min?