Sql Query To Use a ' SELECT ' statement with the MIN() or MAX() function.


To retrieve the minimum or maximum value of a numeric column in a record from the existing created table. Then we can use a ' SELECT ' statement with the MIN() or MAX() function.

Statement 1 will retrieve the minimum of the salary of all employees from the Employees table in the Employee DB Database.

Statement 2 will retrieve the maximum of the salary of all employees from the Employees table in the Employee DB Database.

Statement 3 will retrieve the minimum of the salary of all employees whose employee_id is greater than 150 from the employees' table in the Employee DB Database

Statement 4 will retrieve the maximum of the salary of all employees whose employee_id is greater than 150 from the employees' table in the Employee DB Database

Enter - Select * from table_name;
SQL Query
SELECT MIN(salary) FROM employees; SELECT MAX(salary) FROM employees; SELECT MIN(salary) FROM employees WHERE employee_id>150; SELECT MAX(salary) FROM employees WHERE employee_id>150;
Output