BETWEEN and NOT BETWEEN Operators in SQL || Lesson 53 || DBMS || Learning Monkey ||

Опубликовано: 28 Сентябрь 2024
на канале: Learning Monkey
1,040
17

BETWEEN and NOT BETWEEN Operators in SQL

In this class, we will understand BETWEEN and NOT BETWEEN Operators in SQL.

We have already discussed the concepts of IN and NOT IN operators in SQL.


BETWEEN and NOT BETWEEN Operators in SQL
BETWEEN Operator in SQL

With Between operator, we can test a list of values.

To understand this, we will consider the table given below.

From the above table, we will try to fetch the details of the students whose salaries are between 200 and 400.

When we use between the values 200 and 400 are also included.

The query is as shown below.

SELECT * FROM students WHERE salary BETWEEN 200 and 400;

The output for the query is as shown below.

NOT BETWEEN Operator in SQL

From the above table, we will try to fetch the details of the students whose salaries are not between 200 and 400.

The query is as shown below.

SELECT * FROM students WHERE salary NOT BETWEEN 200 and 400;

The output for the query is as shown below.


#learningmonkey #dbms #placements #gatecse #gatedbms #campusplacements




Link for playlists:
   / @learningmonkey  


Link for our website: https://learningmonkey.in

Follow us on Facebook @   / learningmonkey  

Follow us on Instagram @   / learningmonkey1  

Follow us on Twitter @   / _learningmonkey  

Mail us @ [email protected]