Online mysql course - finding the minimum and maximum values - mysql min and max functions
online mysql course, finding the minimum and maximum values, mysql min and max functions
Online MySQL course - Finding the minimum and maximum valuesGo to Online MySQL course - Finding the minimum and maximum valuesSQL tutorialGo to SQL tutorialWeb development tutorialsGo to web development tutorialsHomepage

Online MySQL course - Finding the minimum and maximum values

MySQL provides inbuilt functions to find the minimum and maximum values.

SQL provides 5 aggregate functions. They are:
1). MIN(): Minimum value
2). MAX(): Maximum value
3). SUM(): The sum of values
4). AVG(): The average values
5). 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.


Minimum value

select MIN(salary) from employee_data;

+-------------+
| MIN(salary) |
+-------------+
|       70000 |
+-------------+
1 row in set (0.00 sec)

Maximum value

select MAX(salary) from employee_data;

+-------------+
| MAX(salary) |
+-------------+
|      200000 |
+-------------+
1 row in set (0.00 sec)



Assignments
  1. List the minimum perks package.
  2. List the maximum salary given to a "Programmer".
  3. Display the age of the oldest "Marketing Executive".
  4. (Tricky!) Find the first and last names of the oldest employee.
   Click here for possible answers


Back Next


AddThis Social Bookmark Button
Page contents: Online mysql course - finding the minimum and maximum values - mysql min and max functions

Page URL: http://www.webdevelopersnotes.com/tutorials/sql/ online_mysql_course_finding_the_minimum_and_maximum_values.php3



Join Mailing List


Feedback/Questions




50+ web hosting FAQs

Search engine for your website

Free software from Google - The Google Pack Collection

Create your own search engine
Search WebDevelopersNotes.com