1 / 16

The Student Database

The Student Database. The Selection Operator . Give me information of students under the age of 18  age<18 (Student). The Projection Operator  . Give me the name, address, and GPA of all the students  name, addr, GPA (Student)  name, GPA, addr (Student) . Sample Query.

step
Télécharger la présentation

The Student Database

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. The Student Database

  2. The Selection Operator  • Give me information of students under the age of 18 • age<18(Student)

  3. The Projection Operator  • Give me the name, address, and GPA of all the students • name, addr, GPA(Student) • name, GPA, addr(Student)

  4. Sample Query • Give me the SID and GPA for students under the age of 18 • sid, GPA(age<18(Student))

  5. The Cross Product Operator  • Give me all combinations of students and the enrollment of students • Student  Enroll = (Student.sid, name, addr, age, GPA, Enroll.sid, dept, cnum, sec)

  6. Selecting on Cross Products • Give me all the information of enrolled students • Student.sid = Enroll.sid(Student  Enroll)

  7. Sample Query • Give me the name and addresses of students taking CS courses whose GPA is below 3.0 • name, addr(dept = ‘CS’  GPA < 3.0  Student.sid = Enroll.sid(Student  Enroll))

  8. The Join Operator • Class Enroll •  Class.dept = Enroll.dept  Class.cnum = Enroll.cnum  Class.sec = Enroll.sec(Class  Enroll)

  9. The Theta-Join Operator  • Class Class.cnum = Enroll.cnum  Enroll.dept = ‘CS’ Enroll • Class.cnum = Enroll.cnum  Enroll.dept = ‘CS’(Student  Enroll)

  10. The Union Operator  • Give me the SIDs of all students • sid(Student  GradStudent)

  11. The Set-Difference Operator – • Give me the department, course number, and section of all classes without any enrolled students • dept, cnum, sec(Class) – dept, cnum, sec(Enroll)

  12. The Set-Intersection Operator  • Give all the instructors who teaches both CS and EE classes • instructor(dept=’CS’(Class)) instructor(dept=’EE’(Class))

  13. The Rename Operator  • Give me pairs of student names who live at the same address • R.name > S.name(name, name(R.addr = S.addr(R(Student) S(Student) ) ) )

  14. The Division Operator / • Give me the SIDs of students who are enrolled in all of the CS classes • sid(Student) – sid(sid(Student dept, cnum, sec(dept=’CS’(Class))) – Enroll)

  15. The Division Operator / • Give me the SIDs of students who are enrolled in all of the CS classes • sid(Student) – sid( sid(Student)  dept, cnum, sec(dept=’CS’(Class)) – Enroll) )

More Related