Note

(DISTINCT) - SELECT DISTINCT column1column2, ... FROM table_name

Select all the different values from the Country column in the Customers table.


SELECT DISTINCT Country FROM Customers;


(WHERE) SELECT column1column2, ... FROM table_name WHERE condition

Select all records where the City column has the value "Berlin".


SELECT * FROM Customers
WHERE City = "Berlin"


(ORDER BY (DESC, ASC) )

SELECT column1column2, ... FROM table_name ORDER BY column1, column2, ... ASC|DESC;

Select all records from the Customers table, sort the result reversed alphabetically by the column City.

SELECT * FROM Customers
ORDER BY City DESC;

Select all records from the Customers table, sort the result alphabetically, first by the column Country, then, by the column City.

SELECT * FROM Customers
ORDER BY Country, City;

(AND) … WHERE condition1 AND condition2 AND condition3 ...;

Select all records where the City column has the value 'Berlin' and the PostalCode column has the value '12209'.


SELECT * FROM Customers
WHERE City = 'Berlin'
AND PostalCode = '12209';

(OR) … WHERE condition1 OR condition2 OR condition3 ...;