MYSQL Basics to Know…..PART-3
AGGREGATE FUNCTIONS — collects set of values to return a single value.
I have used my favorite comics data in creating database and a table.
- The Vision,Volume 1: Little Worse Than A Man
- Batman: The killing Joke
- Venom, Volume 1: Homecoming
- Venom,Volume 2: The Abyss
- The Flash : A Celebration of 75 Years
COUNT() : counts number of rows in a database.
MIN() : It shows lowest number of values in a table.
MAX() : It shows the highest number of values in a table.
For MIN Title and pages.In this below syntax it shows only Title and pages which is in ascending order and has a LIMIT -1 (which gives only 1 row data).
The below syntax is based on descending order which can be also used for MAX() syntax.
SUM() : It calculates sum of selected set of columns.
AVG() : It calculates average of selected set of columns.