The database itself means the collection of a vast amount of data. Also, the database can include even more than a thousand records. But sometimes, while working on the database, we need to retrieve limited data to perform certain operations.
For example, If the database has a table with employee details. Also, it carries the records of the same employee multiple times. So, In that case, we can filter the data in a datable to get the duplicate records using the WHERE() clause. So to conclude, we can say that the WHERE() clause in the database is to filter the data as per the condition required.
Syntax:
SELECT * from table_name
WHERE condition...;
Example:
we have the table stu shown below:
Stu | |||
Name | Section | Roll_No | Subject |
Radha | B | 180 | Science |
Shruti | B | 16 | Science |
Sneha | B | 17 | Science |
Akshita | C | 1 | Commerce |
Bhoomika | C | 16 | Humanities |
Check the details of Students with science as a Subject
SELECT * from Stu
WHERE Subject='Science';