Where Clause

Advertisements

Prev Tutorial Next Tutorial

Where Clause

Where Clause is used to extract only those records that satisfied the given condition, like fetch only those employee record which have more than 30000 salary.

When use where clause ?

  • To retrive only specific record
  • To delete only specific record
  • To update only specific record

Syntax

SELECT column_name,column_name
FROM table_name
WHERE column_name operator value;

Employee table

emp_idnamesalary
101Amit24000
102Rahul34000
103Sultan54000
104Gaurav26000
105Hitesh35000

Example

SELECT * from Employee
WHERE salary>30000;

Result after Execute above query.

emp_idnamesalary
105Hitesh35000
102Rahul34000
103Sultan54000

Operators in The WHERE Clause

WHERE clause uses some conditional selection, which is given below;

OperatorDescription
1=Equal
2<>Not equal. Note: In some versions of SQL this operator may be written as !=
3>Greater than
4<Less than
5>=Greater than or equal
6<=Less than or equal
7BETWEENBetween an inclusive range
8LIKEIt is used to search for a pattern
9INIt is used to specify multiple possible values for a column

Prev Tutorial Next Tutorial

Google Advertisment

Buy This Ad Space @$20 per Month, Ad Size 600X200 Contact on: hitesh.xc@gmail.com or 9999595223

Magenet is best Adsense Alternative here we earn $2 for single link, Here we get links ads. Magenet

For Projects 9999595223

Google Advertisements


Buy Websites 9999595223

Buy College Projects with Documentation Contact on whatsapp 9999595223. Contact on: hitesh.xc@gmail.com or 9999595223 Try this Keyword C++ Programs

Advertisements