Question: If you have this schema, provide SQL queries for the following: EMPLOYEE Fname Minit Lname Ssn BdateAddress S Sex Salary Super ssn Dno DEPARTMENT Dname

If you have this schema, provide SQL queries for the following:

If you have this schema, provide SQL queries for the following: EMPLOYEEFname Minit Lname Ssn BdateAddress S Sex Salary Super ssn Dno DEPARTMENT

EMPLOYEE Fname Minit Lname Ssn BdateAddress S Sex Salary Super ssn Dno DEPARTMENT Dname Dnumber Mgr_ssn Mgr_start_date DEPT LOCATIONS Dnumber Dlocation PROJECT Pname Pnumber Plocation Dnum WORKS_ON Essn Pno Hours DEPENDENT Essn Dependent name Sex Bdate Relationship Provide MySQL queries for the following: 1. 2. 3. Retrieve the birthdate and address of the employee(s) whose name is John B. Smith Retrieve the name and address of all employees who work for the Research department. For every project located in Stafford, list the project number, the controlling department, and the manager's last name, address and birthdate Retrieve the names of each employee who works in all projects controlled by department 5 Find the list of all project numbers for projects that involve an employee whose last name is Smith, either as a worker or as a manager of that department that controls the project. Retrieve the names of all employees who have two or more dependents. Retrieve the names of all employees who have no dependents. For each employee, find the employee's first and last name and the first and last name of their immediate supervisor 4. 5. 6. 7. 8. 9. Retrieve all employees in department 5 whose salary is between $30,000 and $40,000. 10. Retrieve the list of employees and the projects they are working on, ordered by department and, within each department, ordered alphabetically by last name, first name 11. Retrieve the social security numbers of all employees who work on projects numbers 1,2, or 3 12. Retrieve the names of all employees who do not have a supervisor 13. Find the payroll (i.e., sum of all the salaries of all employees), maximum salary, minimum salary and average salary in the Research department. 14. Find the total number of employees in the Research department. 15. How many different salaries are paid by the Company? 16. For each project, retrieve the project number, the project name, and the number of employees from department 5 who work on the project. name, and the number of employees who work on the project. number of employees who are making more than $40,000. 17. For each project on which more than two employees work, retrieve the project number, project 18. For each department that has more than 5 employees, retrieve the department number and the

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!