Loading, please wait...

Clauses

How To Use Where Clause In SQL

 

Introduction:
In this article, you will learn what where clause is and how to use where clause in SQL.


Where clause is used to define a term while fetching the data from one or more tables. You will use where clause to clean the data and fetch only the mandatory records. Which terms and conditions we assign in this clause if it is fulfilled, it returns only a particular value from the table.

 

We use where clause in Select, Update, Delete statement etc.

 

Syntax

The basic syntax of where clause is as follows:

select column1, column2...... from table_name where [condition];

 

We can use many conditions in the where clause, using comparison operator and logical operators. Like- >, <, =, LIKE, NOT etc.

 

Step 1: We write the query.

 

 

 

Now, we select the query and execute this.

 

Step 2: The output of the query, given above, is -

 

 

 

Step 3: We also find out the single column data with where clause.

 

 

 

Step 4: The output is:

 

 

 

Summary:
Thus, we learned where clause in SQL.