For the relational database instance, shown in the figure above, write relationa
ID: 3825144 • Letter: F
Question
For the relational database instance, shown in the figure above, write relational algebra expressions for the following data retrieval requirements. Please type your answer.
1. List all male employees, who do NOT work in department number 5 but have salary higher than $35,000
2. List name, birth date and relationship for all dependents of employee John B. Smith.
3. List name for all projects, which is NOT managed by department number 5 but is located in Houston. Use the DIFFERENCE operation for this data retrieval requirement.
4. List name for all departments located in Houston. Use the NATURAL JOIN operation for this data retrieval requirement.
5. List SSN for all employees, who works on project “ProductX”.
CHAPTER 6/THE RELATIONAL DATA MODEL ANDRELATIONAL ALGEBRA 146 EMPLOYEE FNAME MINIT LNAME SEN BOATE ADDRESS SEx SALARY SUPERSSN DNO 333445555 DEPT LOCATIONS PNUMEER DogATION DEPARTMENT DNAME ONMMEER MORSSN NORSTARTDATE WORKS ON ESSN HOURS PNAME TENIMMBER PLOCATION ONUM PROTECT DEPENDENT ESSN DEPENDENT NAME SEX BDATE RELATIONSHIP Figure 6.6 A relational database instance (state) of the ooMPANY schema.Explanation / Answer
1) Select * from employee e where e.dno<>5 and e.salary>35000 and e.sex='M';
2) Select s.dependent_name,s.Bdate, s.relationship from dependent s, employee e where e.fname='John' and e.minit='B' and e.lname='Smith' and e.ssn=s.essn
3) Select p.name from project p where p.plocation='Houston' minus (Select p1.pname from project p1 where p1.dnum=5);
4) Select d.dname from department department d, dept_locations d1 where d1.dlocation='Houston' and d.dnumber=d1.dnumber
5) Select e.SSN from employee e, project p where e.dno=p.num and p.pname='ProductX'
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.