programplug Logo



SQL Where Clause

WHERE CLAUSE IN SQL



Where Clause is used to specify the records that statisfied the given condition, like fetch only those students records which have more than 70% marks.
The Where Clause is not used in the select statement, but it work in the UPDATE,DELETE statement etc.

When use where clause ?

  • It Delete only specific rows.
  • It retrive only specific record.
  • It update only specific record.
Syntax:
 SELECT column1, column2,column3.. columnN 
FROM table_name
WHERE [condition]
	
Example: Employee table:
emp_id emp_name emp_Salary
01 Namit 41000
02 Peter 20000
03 Tony 55000
04 David 26500
05 Greg 40000

Condition Example:

DELETE FROM Employee
WHERE salary<30000;
			  
Result After Delete Condition implement:
emp_id emp_name emp_Salary
01 Namit 41000
03 Tony 55000
05 Greg 40000