Student(sid, name, addr, age, GPA);
Enroll(sid, dept, cnum, sec)
Q11:
Find the names of students whose GPA is higher than some other student.
Q11=
{
name

!
id, ad, ag, gp
"
id, name, ad, ag, gp
#$
Student
%
!
i2, n2, ad2, ag2, g2
"
i2, n2, ad2, ag2, g2
#$
Student
%
gp>g2}
Q12:
Find the names of students who have the lowest GPA.
Q12=
{
name

!
id, ad, ag, gp
"
id, name, ad, ag, gp
#$
Student
%
¬
(
!
i2, n2, ad2, ag2, g2
"
i2, n2, ad2, ag2, g2
#$
Student
%
g2<gp)}
Alternatively:
Q12=
{
name

!
id, ad, ag, gp
"
id, name, ad, ag, gp
#$
Student
%
i2, n2, ad2, ag2, g2
"
i2, n2, ad2, ag2, g2
#$
Student
'
g2>gp)}
'
is the implication symbol:
A
'
B
means
¬
A
(
B.
Q9:
Find the ids of students whose GPA is greater than all students taking CS classes
Q9=
{
id

!
n, ad, ag, gp
"
id, n, ad, ag, gp
#$
Student
%
¬
(
!
i2, n2, ad2, ag2, g2
"
i2, n2, ad2, ag2, g2
#$
Student
%
g2>gp
%
!
cn, s
"
i2, ‘cs’, cn, s
#$
Enroll) }
Some symbols of convenience
…  {}
¬
Relational Algebra
Q11:
Find the names of students whose GPA is higher than some other student.
!
student.name(