CBSE 2026 results are out, Mukul scored a perfect 100/100 in Computer ScienceSee all toppers →

KwickAcademy Databases and SQL · 5 min · free

SQL Operators: BETWEEN, IN, LIKE and IS NULL

5 min4 KwickClipsFull text belowFree
Next lesson →Kajal Ma'am (MCA), teaching since 2004Remembered in this browser

BETWEEN checks a range and includes both ends, IN matches a list, LIKE matches a text pattern and IS NULL finds missing values. = NULL finds nothing, because NULL means unknown.

Follows the syllabus of: CBSE Class 12 Computer Science (083), CBSE Class 11 Informatics Practices (065), CBSE Class 11 Information Technology (802), ICSE Class 10 Computer Applications

On screen in this lesson

BETWEEN: points to remember

Same as marks >= 65 AND marks <= 88
Both end values are included
Write the smaller value first
NOT BETWEEN picks values outside the range

IN: points to remember

Same as city = 'Pune' OR city = 'Delhi'
Works with numbers too: roll IN (1, 3, 5)
NOT IN keeps values missing from the list

LIKE wildcards

WildcardMatchesExample
%any characters'R%' starts R
_exactly one char'_e%' 2nd is e

Which operator to use

QuestionOperatorExample
In a range?BETWEEN65 AND 88
One of a list?IN('Pune','Delhi')
Text pattern?LIKE'R%'
Value missing?IS NULLmarks IS NULL

Quick recap

BETWEEN a AND b includes both ends
IN (list) is a short form of many ORs
LIKE: % any characters, _ exactly one
= NULL finds nothing; use IS NULL
NOT works with all: NOT BETWEEN, NOT IN, NOT LIKE

Quick answers

Does BETWEEN 65 AND 88 include 65?

Yes. Both ends are included.

What does '_e%' match?

Any value whose second letter is e.

KwickClips from this lesson

Short clips, one idea each. Good for revision the night before.

The full lesson, in text

Hello students, welcome to Kwickprep. Why does where marks equals NULL return nothing, even when a student has no marks? Today we will learn four special operators that make where shorter and smarter. They are between, in, like and is NULL.

All our examples use one table called student. It has five columns: roll, name, section, marks and city. Kabir was absent for the test, so his marks are NULL. NULL means no value at all. It is not zero, and it is not a blank space.

Between checks whether a value lies in a range. We write the lower value first, then and, then the higher value. Between sixty five and eighty eight includes both end values. So Neha with exactly sixty five and Riya with exactly eighty eight are both kept.

Remember four points about between. It means exactly the same as greater than or equal to sixty five and less than or equal to eighty eight. Both end values are included, and exams test this often. Write the smaller value first, or you will get no rows. Not between gives the values outside the range, so here it would give only Meera.

In checks whether a value matches any item in a list. The list goes in round brackets, with commas between items. City in Pune, Delhi finds every student from Pune or Delhi. That is Aman, Kabir and Meera.

Here is why in is useful. It is a short form of many conditions joined with or. It works with numbers too, so roll in one, three, five gives Riya, Neha and Meera. Not in keeps the values that are not in the list, so city not in Pune, Delhi gives Riya and Neha.

Like matches text with a pattern, and the pattern uses wildcards. A wildcard is a symbol that stands for unknown characters. The percent sign matches any number of characters, even zero. The underscore matches exactly one character.

Percent a means any characters, then the letter a at the end. So this finds names ending in a. Riya, Neha and Meera match. In the same way, R percent finds names starting with R, and percent ee percent finds names containing ee anywhere.

Underscore e percent means exactly one character, then e, then anything. So the second letter must be e. Neha and Meera match. Pause and predict. How many names match four underscores? Only Riya, Neha and Aman, because each has exactly four letters. In MySQL, like usually ignores capital and small letters.

Now the question from the start. NULL means the value is unknown. Any comparison with an unknown value is also unknown, never true. So marks equals NULL finds no rows, and it gives no error either. This silent mistake is very common in exams.

The correct way is is NULL. Where marks is NULL finds Kabir, whose marks are missing. Is not NULL does the opposite. It would give the other four students, whose marks are filled in.

These operators work together with and, or and not. Here the city must be Surat or Pune. The marks must not be NULL. And the name must end in a. Aman fails the last check, so we get Riya, Neha and Meera.

Here is a table to help you choose. For a range of values, use between. To match one of several values, use in. To match a text pattern, use like with wildcards. To find missing values, use is NULL, never equals NULL.

Let us revise what we learned today. Between includes both end values. In is a short form of many or conditions. With like, percent matches any characters and underscore matches exactly one. Equals NULL finds nothing, so always use is NULL or is not NULL. And not works with all of them, like not between, not in and not like. Try each operator on your own table and predict the rows first.

Courses that teach this

CourseUnit
CBSE Class 12 Computer Science (083)Database Management
CBSE Class 11 Informatics Practices (065)Database concepts and the Structured Query Language
CBSE Class 11 Information Technology (802)Part B, Unit 4: RDBMS
ICSE Class 10 Computer ApplicationsClass as the Basis of All Computation

Voice-over in this lesson is AI-generated. The script is written and checked by Kajal Ma'am. Boards can revise a syllabus mid-year, so confirm anything you plan around against the official board circular. Keep your passwords, OTPs and ID numbers to yourself — we never ask for them. To reach Kajal Ma'am, use the WhatsApp button; sharing your number there is how we call you back.

Free to watch, no sign-up. Live classes with Kajal Ma'am are the paid course; these lessons stay free either way.

Want a plan that actually fits your board dates?

Ask Kajal Ma'am directly, 20+ years teaching computer science. Free demo class first, no payment.

Talk to Kajal Ma'am on WhatsApp

Or see the Class 12 Computer Science course →

Studying outside India?

We coach CBSE, IGCSE & international students across the globe, one-to-one, in your local time zone.

Visit International →