The student database
This presentation is the property of its rightful owner.
Sponsored Links
1 / 16

The Student Database PowerPoint PPT Presentation


  • 128 Views
  • Uploaded on
  • Presentation posted in: General

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.

Download Presentation

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.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -

Presentation Transcript


The student database

The Student Database


The selection operator

The Selection Operator 

  • Give me information of students under the age of 18

    • age<18(Student)


The projection operator

The Projection Operator 

  • Give me the name, address, and GPA of all the students

    • name, addr, GPA(Student)

    • name, GPA, addr(Student)


Sample query

Sample Query

  • Give me the SID and GPA for students under the age of 18

    • sid, GPA(age<18(Student))


The cross product operator

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)


Selecting on cross products

Selecting on Cross Products

  • Give me all the information of enrolled students

    • Student.sid = Enroll.sid(Student  Enroll)


Sample query1

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))


The join operator

The Join Operator

  • ClassEnroll

    •  Class.dept = Enroll.dept  Class.cnum = Enroll.cnum  Class.sec = Enroll.sec(Class  Enroll)


The theta join operator

The Theta-Join Operator

  • Class Class.cnum = Enroll.cnum  Enroll.dept = ‘CS’ Enroll

    • Class.cnum = Enroll.cnum  Enroll.dept = ‘CS’(Student  Enroll)


The union operator

The Union Operator 

  • Give me the SIDs of all students

    • sid(Student  GradStudent)


The set difference operator

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)


The set intersection operator

The Set-Intersection Operator 

  • Give all the instructors who teaches both CS and EE classes

    • instructor(dept=’CS’(Class)) instructor(dept=’EE’(Class))


The rename operator

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) ) ) )


The division operator

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)


The division operator1

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)

      )


  • Login