SQL WHERE CLAUSE – SQL TUTORIAL | Software Testing Material

SQL WHERE Clause:

The SQL WHERE clause is used to specify a condition while fetching the data from a table. We use WHERE clause to filter the records and fetching only necessary records.

The WHERE clause is not only used in SELECT statement, but it is also used in UPDATE, DELETE statement, etc.,

SQL WHERE Clause Syntax:

You can specify a condition using comparison or logical operators like >, <, =, LIKE, NOT, etc.

SQL WHERE Clause Example:

In the below image, you could find total number of records related to first SELECT query are and total number of records are 2 related to second SELECT query.

In the second SELECT query, we used WHERE clause with the condition RUNS>20. Note: Runs greater than 20 doesn’t man Runs equal to 20. So in the result we could see just two records.

SQL Where Clause

In the next tutorial, we will see How To Use SELECT DISTINCT Query in SQL

Check out the complete SQL Tutorial by clicking on below link:

SQL Tutorial – Complete

SQL Where Clause

Rajkumar SM is a founder of SoftwareTestingMaterial. He is a certified Software Test Engineer by profession and blogger & youtuber by choice. He has an extensive experience in the field of Software Testing. He writes here about Software Testing which includes both Manual and Automation Testing. He loves to be with his wife and cute little kid 'Freedom'.

Leave a Comment

Share via
Copy link
Powered by Social Snap