SELECT column_name(s)
FROM table_name
WHERE condition
GROUP BY column_name(s)
HAVING condition
ORDER BY column_name(s);
GROUP BY: is used to collaborate
with the SELECT statement to arrange
matching data into groups.
ORDER BY: is for sorting result
either in descending or ascending order.
SELECT country, COUNT(*) AS number
FROM Customers
GROUP BY country;
SELECT NAME, SUM(SALARY) FROM Employee
GROUP BY NAME;
--- GROUP FUNCTION | MULTI ROW FUNCTION | AGGREGATE FUNCTION
--- COUNT , MAX , MIN , SUM , AVG
Multiple Row Functions (Group functions, Aggregate functions):
(Count, MIN , MAX, AVG, SUM)
will run for multiple rows and return a single value