IN and NOT IN Operators in SQL | SQL | MySQL

Опубликовано: 17 Июнь 2026
на канале: code with fun
32
1

How and why to use IN and NOT IN operators in SQL

In this video:
✅ What are IN and NOT IN operators, and how do they work?
✅ Real-world use cases for efficient data filtering.
✅ Key differences and when to use IN vs. NOT IN.
✅ Examples to tackle complex problems.

📌 Don’t forget to subscribe for more advanced SQL topics!

#SQL #DataAnalysis #DatabaseQueries #AdvancedSQL #SQLTutorial #inoperator

All the SQL code from this video is available for you to copy and paste for your practice.

_________________________________________________________
CREATE SCHEMA school;
USE school;

CREATE TABLE students_detail (
student_id VARCHAR(5) PRIMARY KEY,
first_name VARCHAR(255) NOT NULL,
last_name VARCHAR(255),
age INT NOT NULL,
enrollment_date DATE NOT NULL,
contact_no VARCHAR(10)
);

INSERT INTO students_detail
(student_id,first_name,last_name,age,enrollment_date,contact_no)
VALUES
(101,"Rishabh","Kumar",24,"2024-10-25",9876543210),
(102,"Amitabh","Singh",23,"2024-10-28",9878543210),
(103,"Mahesh","Dubey",23,"2024-11-01",9999943210),
(104,"Kamlesh","Bansal",25,"2024-11-03",9878549810),
(105,"Amit","Pandey",24,"2024-11-05",9878543212),
(106,"Mahi","Sen",22,"2024-11-05",9878543277),
(107,"Ab","",20,"2024-11-11",8888888888),
(108,"A","Shetty",21,"2024-11-14",7777777777),
(109,"Varun",NULL,19,"2024-11-15",7878787878);
____________________________________________________________

In Operator in SQL
Not In Operator in SQL