SQL AND OR Operators – SQL TUTORIAL | Software Testing Material

SQL AND OR Operators:

In this post, we will see both SQL AND OR Operators in detail.

SQL AND Operator: It fetches the records only if both the first and the second condition are true.

Syntax:

Example:

In the below image, you could see two SELECT queries. First SELECT query returns the complete records from the table SCOREBOARD. Second SELECT query returns only the values where the value in the Playername column is equal to Sachin and value in the Runs column is equal to 100. Both the conditions should become true.

SQL And

SQL OR Operator: It fetches the records if any one of the condition is true.

Syntax:

Example:

In the below image, you could see two SELECT queries. First SELECT query returns the complete records from the table SCOREBOARD. Second SELECT query returns only the values where the value in the Playername column is equal to Sachin or value in the Runs column is equal to 90.

SQL Or

In the next tutorial, we will see How To INSERT Data in a Table in SQL

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

SQL And Or Operators

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