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

# The Student Database PowerPoint PPT Presentation

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.

## Related searches for The Student Database

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

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

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

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

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

• Give me all the information of enrolled students

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

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

• ClassEnroll

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

### 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 

• Give me the SIDs of all students

• sid(Student  GradStudent)

### 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 

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

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

### 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 /

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

)