Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Database Systems- Assignment 1 Due Date: Sunday. 29/4/2018. 11:00PM Student Name

ID: 3714686 • Letter: D

Question

Database Systems- Assignment 1 Due Date: Sunday. 29/4/2018. 11:00PM Student Names 1. Student IDs: 1. 2. Section: (Total Marks From 5) Given the following Relations, use Relational Algebra Query Language to apply the following queries: Professor SsnProfName Salary Nationality Teaches: ProfSsn CourseCode Semester Course: CourseName Code CriditHours Q1:Display a list of "Saudi" professors data who got salary more than 10.000SR. Q2:Display a list of professor names and nationality who got salary more than 20.000SR. Q3:Display a list of professor names and code of courses he taught in "Summer" semester Q4: Display a list of professor who taught the course "CS330" but Never taught the course"IS220" Q5: Display a list of professor who taught the courses that professor "Abdullah" taught.

Explanation / Answer

1. List of "Saudi" Professors data who got salary more than 10.00 SR.

SQL Query:-

select ProfName from professor where Nationality="Saudi" and salary>10.00

Relational Algebra Query:-

II profName(o- Nationality="Saudi" and salary>10.00)(Professor) -> here || used for pi and o- for sigma

2. list of Professor names and nationality who got salary more than 20.00SR

select ProfName, Nationality from Professor where salary>20.00SR

IIprofnam,nationality(o- salary>20.00SR)(Professor)

3. List of Professor Names and code of courses he taught in Summer Semester

IIprofName,code(o-(Professor? Teaches)) :--   ? is natural join

4. List of Professor Names and code of courses who taught the course "CS330" but never taught the course "IS220"

IIprofName,code(o-Course.code=CS330 and Course.code != IS220(Professor? Teaches? Course))

5. List of professor who taught the courses that professor "Abdullah" taught

course taught by abdullah:-

S<-(II teaches.courseCode(o- profName="Abdullah"(professor join (Teaches natural join course))))

same course taught by others:-

IIprofName(o-(Course.CourseCode=S.courseCode)(professor natural join S))