SQL WHERE QUERY


The SQL WHERE clause is used to specify a condition while fetching the data from single table or joining with multiple tables.

If the given condition is satisfied then only it returns specific value from the table. You would use WHERE clause to filter the records and fetching only necessary records.

The WHERE clause is not only used in SELECT statement, but it is also used in UPDATE, DELETE statement, etc.

Syntax

SELECT column1, column2, columnN 
FROM table_name
WHERE [Condition]

Example

idnamefee
11Ashwani2000
12Sachin3000
13Deepak20000
14Soun200
15Sanjay3000
SELECT id,name FROM student WHERE fee=3000
Output
idnamefee
12Sachin3000
15Sanjay3000

Share this article on