# WHERE Clause in SQL

Databases contains huge amounts of data and you don’t need to get all the data all the times. Sometimes you only need a specific set of data. Where clause in SQL helps you filter data. It helps you get only the records that you are interested in.

#### Syntax of Where Clause –

SELECT column1, column2
FROM table_name
WHERE condition

Let’s say that you want to find all the cities information from India. To select only the records from India, you write WHERE CountryCode = ‘IND’

SELECT
Name,
CountryCode,
District,
Population
FROM city
WHERE CountryCode = 'IND';

In this example we used the equality operator but SQL provides many operators that you can use to filter data.

Suppose you want to find all the cities from India whose population is greater than or equal to 1 Million.

SELECT
Name,
CountryCode,
District,
Population
FROM city
WHERE CountryCode = 'IND' AND
Population >= 1000000

Rating: 1 out of 5.