Question
Write the following queries in SQL select statements. a) For each department, retrieve the departments name, the department managers name, the departments locations, and the
Write the following queries in SQL select statements.
a) For each department, retrieve the departments name, the department managers name, the departments locations, and the names of the projects controlled by the department.
b) Retrieve the number and name of each department that controls at least one project that is in the same location (Plocation) as the departments location (Dlocation). Write this query without using a quantifier, i.e., write using only joins.
c) Retrieve the number and name of each department that does not control any project that is in the same location (Plocation) as the departments location (Dlocation).
Figure 5.7 Referential integrity constraints displayed on the COMPANY relational database schema EMPLOYEE Fname |Minit Lname SenBdate Address S ex SalarySuper ssn Dno DEPARTMENT Dname Dnumber Mgr ssn Mgr start date DEPT LOCATIONS Dnumber Dlocation PROJECT Pname Pumber Plocation Dnum WORKS ON Essn Po Hours DEPENDENT Essn Dependent name Sex BdateRelationship
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started