SQL BETWEEN Operator – SQL TUTORIAL | Software Testing Material

SQL BETWEEN Operator:

SQL BETWEEN operator selects values within a range. The values can be numbers, text, or dates.

SQL BETWEEN Syntax:

SQL BETWEEN Example:

In the below image, you could find three SELECT queries. First SELECT query returns complete records from the table SCOREBOARD where as other two SELECT queries returns based on WHERE Clause.

In the second and third SELECT query, we took BETWEEN Operator.

Second query returns the values where values in the Runs column are between 90 and 100 and the third query returns where the values in the Runs column are between 20 and 100.

SQL Between

SQL NOT BETWEEN Operator:

Syntax:

 Example:

In the below image, you could find three SELECT queries. First SELECT query returns complete records from the table SCOREBOARD where as other two SELECT queries returns based on WHERE Clause.

In the second and third SELECT query, we took BETWEEN Operator.

Second query returns the values where values in the Runs column are not between 90 and 100 and the third query returns where the values in the Runs column are not between 20 and 100.

SQL Not Between

In the next tutorial, we will see How To Use AND OR OPERATOR in SQL

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

SQL Tutorial – Complete

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