Starting from:

$20

SQL Queries Solution

Make a T-SQL statement that will count all employees in the Employees table.
Modify the query you wrote in the previous step to only show the count of Employees with a Column header of ‘Employee Count’.
Make a T-SQL statement using GROUP BY to display the employee count from each department. The display is to be the Department Name followed by the Employee Count. Use those as the column headers.
Modify the query from the previous step to include a HAVING clause that will return rows where the Department Employee count is greater than three.
Make a T-SQL statement using GROUP BY to display the average employee salary for each department. The display is to be the Department Name followed by the Employee Annual Salary Average. Use those as the column headers.
Make a T-SQL statement using GROUP BY to display the maximum and minimum employee salary for each department. The display is to be the Department Name followed by the Maximum Employee Annual Salary and then the Minimum Employee Annual Salary. Use those as the column headers.
Make a T-SQL query to show the average annual salary for all employees (even those without a department).
Make a T-SQL query to show the maximum annual salary for all employees (even those without a department).
Make a T-SQL query to show the minimum annual salary for all employees (even those without a department).
Demonstrate the use of a subquery.

More products