SQL where statement

OBJECTIVE

In this chapter you will learn:

where statement
Syntax of where statement
Example of where statement

 

About where statement

SQL where statement is also known as where clause which is used to retrieve data with a condition. If the table of the database will fulfill the statement then you will retrieve the data otherwise it will raise an error.

Syntax of where statement

1. Select * from table_name where condition

2. Select column_name1, column_name2…. where condition

Example of where statement

 

Guide:

In the given example where clause is used to retrieve the employee details whose employeeid is 1 so it only display only one record. Output is given for your better guide so try to run the given command in your system and match the output.

 

image of where statement

 

SUMMARY

In this chapter you have learned about where clause or statement so try to use yourself. In the next chapter you will learn about AND & OR statement.


Leave a Reply

Your email address will not be published. Required fields are marked *