The most frequent and simple data querying in MySQL is a combination of SELECT statement and WHERE clause, where the clause directly tells the MySQL how to reference wanted data retrieval.

To retrieve stored data, the simple SELECT query is made like this:


SELECT Column FROM Table_name;

In this way, data of the specified column will be produced as result. But, what when you need to retrieve some data on certain condition? Here, WHERE clause jumps-in. It tells the specific condition within a query that need to be satisfied on data. As an instance:

SELECT Emp FROM Employee WHERE salary > 10000;

The above query will return all the employees having salary greater than 10000.

A simple, but yet more complex, example with a multiple condition may be given by applying the OR operator, for instance:

SELECT * FROM Employee WHERE salary > 100000 OR bonus > 12;

Some of more common operators and other clauses that come in handy with the WHERE clause, are: