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

Overview: Becoming proficient in formulating useful database queries takes pract

ID: 3805296 • Letter: O

Question

Overview: Becoming proficient in formulating useful database queries takes practice. Knowing how to use pure Relational Algebra is useful background for learning SQL. To use SQL, you may not need to call the Relational Algebra operators directly, but you do need to specify the critical parts of them. It helps to know how those parts fit in to the query. Software: Richard Leyton, then a student at Oxford Brookes University, wrote a simple DBMS called LEAP as a project. The current version of LEAP is 1.2.6 and runs reasonably well under the LINUx operating system. The syntax of its relational algebra commands differs a bit from what we use in class, but converting between the notations is not hard. There does exist a version of LEAP for Windows, but I have never used it and, given its age, cannot recommend it.

Explanation / Answer

1.select * from emplyee where deptno=5

2.select SSN FROM Employee e,work _on w,preposal p where e.ssn=w.empssn and w.pno=p.pnumber

3.select depertment_name,fname from Depertment d,employee e where e.empno=d.deptno cross join dept

4.select deptno from depertment where dname=' research'

5.select * from employee ,depertment where dname='Alce'

7.select * from employee e,depertment d where e.deptno=d.deptno deptno=5

8.select e.managername,e.bdate from empoyee e ,proprsal p where p.pname='Stafford'

9.select dname from empoyee where sex='female'

10.select dname from employee where sex='m') union(select dname from employee where sex in(male,female))

11.select dname from employee e,depertment d where e.deptno=d.depto and dname not in ProductY

12.SELECT DNAME FROM EMPOYEE,DEPERTMENT D WHERE SEX IN(MALE,FEMALE) GROUP BY DETPNO