WHERE Clause is used to filter the record from the table through condition.
Syntax:-
SELECT column(s) From table_name WHERE [condition]
Example:- Suppose you have employees table which has 7 records.
+----+------------+-----------+----------------+-----------+ | id | first_name | last_name | email | country | +----+------------+-----------+----------------+-----------+ | 1 | John | Tailor | john@abc.com | USA | | 2 | Rom | Tailor | rom@abc.com | USA | | 3 | Andrew | Symonds | andrew@abc.com | Australia | | 4 | Miacle | clerk | miacle@abc.com | Australia | | 5 | Sachin | Tendulkar | sachin@abc.com | India | | 6 | Virat | Kohli | virat@abc.com | India | | 7 | rohit | NULL | rohit@abc.com | India | +----+------------+-----------+----------------+-----------+
Now you want to get the record, which country belongs to India
SELECT * FROM employees WHERE country='India'
Output:-
+----+------------+-----------+----------------+---------+ | id | first_name | last_name | email | country | +----+------------+-----------+----------------+---------+ | 5 | Sachin | Tendulkar | sachin@abc.com | India | | 6 | Virat | Kohli | virat@abc.com | India | | 7 | rohit | NULL | rohit@abc.com | India | +----+------------+-----------+----------------+---------+ 3 rows in set (0.00 sec)