hw1FullSol

hw1FullSol -...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
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(
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 04/28/2010 for the course CS 143 taught by Professor Zaniolo during the Fall '01 term at UCLA.

Page1 / 3

hw1FullSol -...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online