Use app×
Join Bloom Tuition
One on One Online Tuition
JEE MAIN 2025 Foundation Course
NEET 2025 Foundation Course
CLASS 12 FOUNDATION COURSE
CLASS 10 FOUNDATION COURSE
CLASS 9 FOUNDATION COURSE
CLASS 8 FOUNDATION COURSE
0 votes
391 views
in Structured Query Language (SQL) by (54.8k points)
closed by

Differentiate IN and NOT IN

1 Answer

+1 vote
by (49.1k points)
selected by
 
Best answer

IN Keyword 

The IN keyword is used to specify a list of values which must be matched with the record values. In other words it is used to compare a column with more than one value. It is similar to an OR condition. 

For example:

SELECT Admno, Name, Place FROM Student WHERE Place IN (“Chennai, “Delhi ”);

Admno Name Place
100 Ashish Chennai
101 Adarsh Delhi
103 Ayush Delhi
104 Abinandh Chennai
105 Revathi Chennai
107 Hema Chennai

NOT IN:

The NOT IN keyword displays only those records that do not match in the list.

For example: SELECT Admno, Name, Place FROM Student WHERE Place NOT IN (“Chennai” , ‘ “Delhi”); will display students only from places other than “Chennai” and “Delhi”.

Admno Name Age
102 Akshith Bangalore
106 Devika Bangalore

Welcome to Sarthaks eConnect: A unique platform where students can interact with teachers/experts/students to get solutions to their queries. Students (upto class 10+2) preparing for All Government Exams, CBSE Board Exam, ICSE Board Exam, State Board Exam, JEE (Mains+Advance) and NEET can ask questions from any subject and get quick answers by subject teachers/ experts/mentors/students.

...