The SQL SELECT Statement
DISTINCT Statement
WHERE Clause
OR and NOT Operators
ORDER BY
The SELECT statement is used to select data from a database.
The SELECT DISTINCT statement is used to return only distinct (different) values.
The WHERE clause is used to filter records. It is used to extract only those records that fulfill a specified condition.
The AND and OR operators are used to filter records based on more than one condition:
The ORDER BY keyword sorts the records in ascending order by default. To sort the records in descending order, use the DESC keywor
SELECT * FROM table_name;
SELECT DISTINCT Country FROM Customers;
SELECT * FROM Customers WHERE Country='Mexico';
SELECT column1, column2 FROM table_name WHERE condition1 AND condition2 AND condition3;
SELECT column1, column2 FROM table_name ORDER BY column1, column2, ... ASC/DESC;