WHERE in SQL

HOW TO USE WHERE CLAUSE IN SQL?

WHERE

WHERE clause in SQL is a data manipulation language (DML) statement. WHERE clause is used in filter the records based on satisfying specific condition(s).

Syntax-

SELECT column_name1, column_name2, โ€ฆcolumn_nameN

FROM <table_name>

WHERE <condition>;

Example-

SELECT CustomerName FROM Customers

WHERE Country=โ€˜Germanyโ€™;

Description-

The records having values from column_name1, column_name2, โ€ฆcolumn_nameN will be filtered and retrieved from table_name on meeting the condition provided with WHERE clause. Above example will provide the name of customers from column CustomerName where value in corresponding column matches to Germany.

Note-

Northwind sample database is used for example.


Posted

in

Tags:

Comments

Leave a Reply