Question: Show all screenshots using SQL Querying a Relational Database COMPANY database For Lab 4 , you use the Company database that you built in Lab
Show all screenshots using SQL Querying a Relational Database COMPANY database
For Lab you use the Company database that you built in Lab and used for Lab
Update the following new changes into the database:
Joyce English with SSN got married with Joe Anderson. Joe is not an employee of the Company and do NOT change the last name of Joyce to Anderson
Jenifer Wallace with SSN just had a new daughter named Erica.
Jenifer Wallace with operatornameSSN is just assigned to a new project number to work on with initial hours.
Add these new entries into Dependent, WorksOn tables in your database then Select from Dependent and Select from WorksOn to show the updated table content.
Note that if you don't insert these data as directed, your query results for Q Q won't be correct.
Write SQL Select statements to retrieve data in the followings:
Q:
For each department, list the first and last name of each employee who is working in the department with the first and last name of his or her immediate supervisor with the department number and name together. Include all the departments including the departments that do not have any employee and all the employees including the ones who do not have any supervisors. List the result in the order of each department number and the first name of each employee.
So your result of Q will list all the department and all the related employees with hisher supervisors including the ones who do not have supervisors.
Different version of Q:
Q: List the same information as Q with a change: List all the employees including the ones who do not have any supervisor, but do not include the departments that do not have any employee in the output.
So your result of Q will list the department and all the related employees with hisher supervisors including the ones who do not have supervisors. So it will be the same as Q except the department won't be included.
Q: List the name of managers who have no dependents.
Q:
Get SSN and the last name of married female employees who work on three or more projects Q:
List the name of employees who is working for 'Research' department and are married but have no children.
Married Select ESSN From Dependent Where relationship 'spouse';
Girls Select ESSN From Dependent Where relationship 'daughter';
Boys Select ESSN From Dependent Where relationship 'son';
Q:
Get the last name of married employees who only have daughters.
Married Select ESSN From Dependent Where relationship 'spouse';
Girls Select ESSN From Dependent Where relationship 'daughter';
Boys Select ESSN From Dependent Where relationship 'son';
Q: Extra Credit for CIS; Required for CIS
Give the last name and ssn of those employees who work in any projects where there are more female than male employees. Figure
Referential integrity constraints displayed on the COMPANY relational database schema.
EMPLOYEE
PROJECT
WORKSON
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
