SQL where statement

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

select * from humanresources.employee where employeeid=1
Guide:

In the given example where clause is used to retrieve the employee details whose employee id is 1 so it only displays only one record. The 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.

More Articles

 

Share your thought



PLEASE DISABLE ADBLOCKER AND SUPPORT US!

Please support us by enabling ads on this page. Refresh

YOU DON'T LIKE ADS, WE ALSO DON'T LIKE ADS!
 
But we have to show ads on our site to keep it free and updated. We have to pay huge server costs, domain costs, CDN Costs, Developer Costs, Electricity and Internet Bill. Your little contribution will encourage us to regularly update this site.