Online MySQL course - Finding the minimum and maximum values
Sponsored Links
MySQL provides inbuilt functions to find the minimum and maximum values.
SQL provides 5 aggregate functions. They are:
- MIN(): Minimum value
- MAX(): Maximum value
- SUM(): The sum of values
- AVG(): The average values
- COUNT(): Counts the number of entries
In this session of the online MySQL course, we'll look at finding the minimum and maximum values in a column.
MySQL MIN() - Minimum value
select MIN(salary) from employee_data; +-------------+ | MIN(salary) | +-------------+ | 70000 | +-------------+ 1 row in set (0.00 sec)
MySQL MAX() - Maximum value
select MAX(salary) from employee_data; +-------------+ | MAX(salary) | +-------------+ | 200000 | +-------------+ 1 row in set (0.00 sec)
- List the minimum perks package.
- List the maximum salary given to a "Programmer".
- Display the age of the oldest "Marketing Executive".
- (Tricky!) Find the first and last names of the oldest employee.
Click this button if you liked the article!
Page contents:
Comments, questions, feedback... whatever!
Recent Articles
Recent Blog Posts
Popular Articles
- Hotmail Sign In page
- Create a Hotmail account - Instructions
- Create Gmail address
- Download and install Outlook Express
- Get your free Gmail address
- Outlook Express new version
- Create my own email address
- Browers for Windows list
- Get email address
- Color combinations for web sites and pages
- Create Yahoo ID
