In this article, where clause will be discussed alongside example.
- To extract the data at times, we need a particular conditions to satisfy.
- ‘where’ is a clause used to write the condition in the query.
select select_list from table_name where condition
A example is given below for better clarification –
Sample table: Student
If a user wants to extract the name of the student who is pursuing Mechanical, the query is as follows:
select name from student where course='Mechanical'
The output is –
‘where’ condition filters only the rows that are evaluated to true. If the condition evaluates to false or unknown, the rows will not be filtered causing an error.
Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.
- Having clause in MS SQL Server
- Distinct clause in MS SQL Server
- Difference between Having clause and Group by clause
- SQL | USING Clause
- SQL | WHERE Clause
- SQL | ON Clause
- SQL | WITH clause
- SQL | Except Clause
- Having vs Where Clause in SQL
- SQL | Intersect & Except clause
- SQL | Sub queries in From Clause
- SQL | With Ties Clause
- PHP | MySQL WHERE Clause
- SQL | LIMIT Clause
- SQL | SELECT TOP Clause
- SQL | Union Clause
- Difference between Where and Having Clause in SQL
- SQL | Distinct Clause
- Difference between From and Where Clause in SQL
- MySQL | PARTITION BY Clause
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.