1.

Differentiate between and not between?

Answer»

BETWEEN and NOT BETWEEN Keywords

The BETWEEN keyword defies a range of values the record must fall into to make the condition true. The range may include an upper value and a lower value between which the criteria must fall into. 

SELECT Admno, Name, Age, Gender FROM Student WHERE Age BETWEEN 18 AND 19;

AdmnoNameGenderAgePlace
101AdarshM18Delhi
103AyushM18Delhi
104AbinandhM18Chennai
105RevathiF19Chennai
106DevikaF19Bangalore

The NOT BETWEEN is reverse of the BETWEEN operator where the records not satisfying the condition are displayed.

SELECT Admno, Name, Age FROM Student WHERE Age NOT BETWEEN 18 AND 19;

AdmnoNameAge
101Ashish17
102Akshith17
107Hema17


Discussion

No Comment Found