Question: Using MySQL and the Company schema below. 1. Using the Company schema, provide a query that lists all employees along with any dependents. Include employees

Using MySQL and the Company schema below.

1. Using the Company schema, provide a query that lists all employees along with any dependents. Include employees without dependents in the result set.

List the employee first name, last name, ssn, and the dependents name and relationship if a dependent exists.

Use the explicit joins.

Expected Result Set Size: 47

2. Using the Company schema, select the unique project numbers and project names where either the project departments manager is Freed or an employees last name is Freed.

Use explicit join notation where necessary.

Nested selects may be needed in this case.

Expected Result Set Size: 2

3. Using the Company schema, list every project name and average employee salary for employees in the project.

Use explicit joins.

Note that the avg salary for project 61 (OperatingSystems) is 42,166.

Expected Result Set Size: 11 i.e. the number of projects.

dependent essn CHAR(9) (FK) dependent name VARCHAR(15) sex CHAR(1) b date DATE relationship VARCHAR(8) works on essn CHAR(g) (FK) pno BIGINT (FK) hours DECIMAL (4 10 employee ssn CHAR(9) superssn CHAR(9) (FK) dno BIGINT (FK) fname VARCHAR(15) minit VARCHAR(1) name VARCHAR(15) bdate DATE address VARCHAR(50) sex CHAR(1) salary DECIMAL(10,2) project pnumber BIGINT dnum BIGINT (FK) pname VARCHAR 25) plocation VARCHAR(15) dept locations number BIGINT (FK) location VARCHAR(15) department number BIGINT mgrssn CHAR(9) (FK) dname VARCHAR(25) mgrStartdare DATE dependent essn CHAR(9) (FK) dependent name VARCHAR(15) sex CHAR(1) b date DATE relationship VARCHAR(8) works on essn CHAR(g) (FK) pno BIGINT (FK) hours DECIMAL (4 10 employee ssn CHAR(9) superssn CHAR(9) (FK) dno BIGINT (FK) fname VARCHAR(15) minit VARCHAR(1) name VARCHAR(15) bdate DATE address VARCHAR(50) sex CHAR(1) salary DECIMAL(10,2) project pnumber BIGINT dnum BIGINT (FK) pname VARCHAR 25) plocation VARCHAR(15) dept locations number BIGINT (FK) location VARCHAR(15) department number BIGINT mgrssn CHAR(9) (FK) dname VARCHAR(25) mgrStartdare DATE

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!