Question: 2. Write an SQL Query that will produce a list of Employees first name, and their Department Names. Show the SQL below: 3. Write an
2. Write an SQL Query that will produce a list of Employees first name, and their Department Names. Show the SQL below:
3. Write an SQL Query that will produce a list of Employees first name, and their Department Names for Departments where the department manager started before January 1, 2003. Show the SQL below:
4. Write the SQL statement to produce a list that contains the employees first and last name, their department name, and the locations of the department for employees in department 1 or 4..
5. Select a list of employees first names and salary whose salary is greater than 30,000 and work in the research department. The WHERE clause should match on the literal Research; do not match on Department number.
6. Write an SQL Statement to produce a list that contains employees first name, the project numbers the employee has worked on, and the number of hours the employee has worked on each project. Sort the list by project number.
7. Write an SQL Query to list the employees first name, SSN, Project number, and the project name.
8. Write an SQL Query to list the employees first name, SSN, Project Number, and the project name for all female employees who have worked more than 25 hours on any one project. Sort the list by SSN.
9. Write an SQL Query to list the employees first name, SSN, and their dependents first name, and dependents birth date.
10. Write an SQL Query to list the employees first name, employees birth date, and their dependents first name and dependents birth date. The list should include both sons and daughters, but not spouses.
11. Write an SQL to list each department number, department name, and department managers name. Sort the list by department number.
12. Write an SQL query that will list the employees first name, department managers SSN, department managers start date for any employees whose children were born after the employees department managers start date. The query result set should also show the dependents name, and the dependents date of birth.
13. Write an SQL statement that will display the first name of all employees who have a dependent. If an employee has more than one dependent, they should only be displayed once.
14. For Projects 1, 2, and 3, show the employees who worked less than 15 hours on the project. The result set should list the project number, project name, employee first name, and hours worked. Sort the results by project number.
15. Using the COUNT function, write an SQL statement that shows how many projects the company is working on.
16. Write an SQL that shows how many distinct locations exist for departments.
17. Write an SQL that lists the employee first name, department number, and department name for all departments located in Houston.
18. Write an SQL that will list the employees first name, and dependents first name and dependents birth date of all dependents who are less than 10 years old based on the date the query was run.
19. Write an SQL statement that will list the Employees first name, SSN, relationship, and dependents first name. If the employee does not have a dependent, then null (or blank) should appear as the dependents first name and relationship.
20. Write an SQL statement that will list the department number, department location, and employees first name for departments which have an office in Bellaire. Only list employees who are either older than 65, or whose salary is greater than 30000.
21. How many rows will be selected from the following SQL Statement:
SELECT D.Dnumber, DL.Dnumber
FROM DEPARTMENT D CROSS JOIN DEPT_LOCATIONS DL
ORDER BY D.Dnumber, DL.Dnumber
22. Write an SQL statement that will list the employees first name, last name, and department number who are either in department 1 or whose last name is in the range of PA through ZZ
23. Write an SQL to select the birthdate of the youngest employee.
24. Write an SQL statement to count the number of times an employee on a project has worked more than 20 hours on a project.
25. Make up an awesome query that involves at least one JOIN clause using the Company Relations database. Supply the query and the question that the query answers
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
