1 / 33

LAB 4

LAB 4. FIGURES. EMPLOYEE TABLE. PROJECT TABLE. DEPARTMENT TABLE. DEPENDENT TABLE. WORKS_ON TABLE. DEPT_LOCATIONS TABLE. RENAMING OPERATION. Note : Ssn shouldn’t be underlined. UNION OPERATION. UNION OPERATION. INTERSECTION OPERATION. SET DIFFERENCE (OR MINUS). CARTESIAN PRODUCT.

pink
Download Presentation

LAB 4

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. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. LAB 4 FIGURES

  2. EMPLOYEE TABLE

  3. PROJECT TABLE

  4. DEPARTMENT TABLE

  5. DEPENDENT TABLE

  6. WORKS_ON TABLE

  7. DEPT_LOCATIONS TABLE

  8. RENAMING OPERATION Note : Ssnshouldn’t be underlined.

  9. UNION OPERATION

  10. UNION OPERATION

  11. INTERSECTION OPERATION

  12. SET DIFFERENCE (OR MINUS)

  13. CARTESIAN PRODUCT

  14. CARTESIAN PRODUCT

  15. CARTESIAN PRODUCT

  16. JOIN OPERATION

  17. NATURAL JOIN OPERATION

  18. NATURAL JOIN

  19. LEFT OUTER JOIN

  20. LEFT OUTER JOIN

  21. RIGHT OUTER JOIN

  22. DIVISION OPERATION

  23. AGGREGATE FUNCTIONS ᵨ R(Dno,No_of_employees,Average_sal)(Dno COUNT Ssn, AVERAGE Salary(EMPLOYEE)) No renaming :

  24. AGGREGATE FUNCTIONS ᵨ R(Dno,No_of_employees,Average_sal)(Dno COUNT Ssn, AVERAGE Salary(EMPLOYEE)) No grouping :

  25. QUERY 1 Retrievethe name andaddress of allemployeeswhoworkforthe‘Research’ department.

  26. QUERY 1 RESEARCH_DEPT <- σ Dname=’Research’ (DEPARTMENT) RESEARCH_EMPS <- (RESEARCH_DEPT Dnumber=Dno EMPLOYEE) RESULT <- ∏ Fname, Lname, Address (RESEARCH_EMPS) OR • ∏Fname, Lname, Address (σDname=’Research’(DEPARTMENT Dnumber=Dno (EMPLOYEE)))

  27. QUERY 2 • Listthenames of employeeswithtwoormoredependents.

  28. QUERY 2 T1(Ssn, No_of_dependents) <- EssnCOUNT Dependent_name (DEPENDENT) T2 <- σNo_of_dependents>2 (T1) RESULT <- ∏Lname, Fname (T2 * EMPLOYEE)

  29. QUERY 3 • Findthenames of employeeswhowork on alltheprojectscontrolledbydepartmentnumber 5.

  30. QUERY 3 DEPT5_PROJS <- ᵨ(Pno)(∏ Pnumber (σ Dnum=5(PROJECT))) EMP_PROJ <- ᵨ(Ssn,Pno)(∏ Essn,Pno(WORKS_ON))

  31. QUERY 3 RESULT_EMP_SSNS <- EMP_PROJ DEPT5_PROJS RESULT <- ∏ Lname, Fname (RESULT_EMP_SSNS * EMPLOYEE)

  32. QUERY 4 Listthenames of managerswhohave at leastonedependent.

  33. QUERY 4 MGRS(Ssn) <- ∏ Mgr_ssn (DEPARTMENT) EMPS_WITH_DEPS(Ssn) ∏Essn (DEPENDENT) MGRS_WITH_DEPS <- (MGRS EMPS_WITH_DEPS) RESULT <- ∏ Lname, Fname (MGRS_WITH_DEPS * EMPLOYEE)

More Related