Select Command Where clause in SQL

Where clause In SQL

WHERE clause select the record conditionally from SQl database. WHERE keyword use with different statement in SQL for example WHERE with SELECT Statement, Delete from statement, Update statement etc.

In This tutorial we explain WHERE clause with SELECT Statement. In SELECT Statement we give a condition with WHERE clause. Those record which satisfied the given were display.

For example if we have a table "student" with following record:

Name Marks Result Grade
Mr. Muneer 500 Pass A
Mr. Naweed 300 Pass B
Mr.tauqeer 450 Pass A
Mr. Jalil 200 Fail Fail

 

The above table contain the student result. if we want to display those record whose result is Pass then we use the following statement.

SELECT * FROM student WHERE Result='pass';

where

student is table name and result is column name and pass are the parameter

The above statment display the following records:

Name Marks Result Grade
Mr. Muneer 500 Pass A
Mr. Naweed 300 Pass B
Mr.tauqeer 450 Pass A

 

we can also use Like operator , > operator , != operator , between operator and in operator and < operator with WHERE clause.

We explain these operator in next tutorial: