SQL PRACTICE: SQL SERVER - Find the Maximum, Minimum, and Average Salary

 Q10. Write an SQL query to find the maximum, minimum, and average salary of the employees.


N.B: I am using the following:

Database -> MSSQL

SQL Dialect -> T-SQL


Consider below an employment table as a source data.

Select  * from employment;

Table 1. Employment Table


Ans: 
select  max(salary) as MaxSalary,
min(salary) as MinSalary,
avg(salary) as AvgSalary
from employment;


Table 2. Aggregate Function of SQL

Comments

Popular posts from this blog

SQL PRACTICE: SQL SERVER - DATEADD Function

SQL PRACTICE: SQL SERVER - Unique Records

SQL PRACTICE: SQL SERVER: DATEDIFF Function