LIMIT: to specify the number of records to return
SELECT column_name(s)
FROM table_name
WHERE condition
LIMIT number;
Example:
SELECT * FROM Customers
LIMIT 3;
SELECT * FROM Customers
WHERE Country = 'Germany'
LIMIT 3;
MIN(): returns the smallest value of the selected column
SELECT MIN(column_name)
FROM table_name
WHERE condition;
MAX(): returns the largest value of the selected column
SELECT MAX(column_name)
FROM table_name
WHERE condition;
COUNT(): returns the number of rows that matches a specified criterion
SELECT COUNT(column_name)
FROM table_name
WHERE condition;
AVG(): returns the average value of a numeric column
SELECT AVG(column_name)
FROM table_name
WHERE condition;
SUM(): returns the total sum of a numeric column
SELECT SUM(column_name)
FROM table_name
WHERE condition;
: used in a WHERE clause to search for a specified pattern in a column
SELECT column1, column2, ...
FROM table_name
WHERE column LIKE pattern;
Examples:
SELECT * FROM Customers
WHERE CustomerName LIKE 'a%';
SELECT * FROM Customers
WHERE CustomerName NOT LIKE 'a%';
This post is based on W3School's articles about SQL.