Assume a table of employees in which each row is an employee who has a name
, a department
, and a salary
.
SELECT department, MIN(salary) AS "Lowest salary"
FROM employees
GROUP BY department;
This would tell you which department contains the employee with the lowest salary, and what that salary is. Finding the name
of the employee with the lowest salary in each department is a different problem, beyond the scope of this Example. See "groupwise max".