Praktikum Basis Data: Data Manipulation Language (DML)
Praktikum Basis Data: Data Manipulation Language (DML)
The MAX() function returns the largest value of the selected column.
SELECT MIN(column_name)
FROM table_name
WHERE condition;
SELECT MAX(column_name)
FROM table_name
WHERE condition;
The SQL COUNT(), AVG() and SUM()
Functions
The COUNT() function returns the number of rows that matches a
specified criteria.
The AVG() function returns the average value of a numeric
column.
The SUM() function returns the total sum of a numeric column.
SELECT column_name(s)
FROM table_name
WHERE condition
GROUP BY column_name(s)
ORDER BY column_name(s);
SELECT COUNT(CustomerID), Country
FROM Customers
GROUP BY Country;
SELECT column_name(s)
FROM table_name
WHERE condition
GROUP BY column_name(s)
HAVING condition
ORDER BY column_name(s);
SELECT COUNT(CustomerID), Country
FROM Customers
GROUP BY Country
HAVING COUNT(CustomerID) > 5;