After you have a good understanding of what SQL can do, it is time to move on to more sophisticated queries
It is important to understand what your database engine is capable of, and what your requirements are for pulling information from your system.
This module will introduce you to some of the more advanced queries used for extracting information from tables.
These new clauses include
- grouping and
You will see how to make sure you skip duplicate information in the database, making the information more meaningful and easier to digest.
Group functions are built-in SQL functions that operate on groups of rows and return one value for the entire group.
These functions are:
COUNT, MAX, MIN, AVG, SUM, DISTINCT
SQL COUNT (): This function returns the number of rows in the table that satisfies the condition specified in the WHERE condition.
If the WHERE condition is not specified, then the query returns the total number of rows in the table.
For Example: If you want the number of drinks in a particular category, the query would be: