SQL Data Analytics • Lesson 6

SQL Operators & Conditions

Learn how to exclude values with <>, match text with LIKE, test missing data with IS NULL, and combine operators with AND and OR.

Your progress0%

0 of 8 concepts completed

Complete the activity and related MCQ to unlock the next concept.

Concept 1NOT EQUAL

Exclude Values with <>

The <> operator (or != in some dialects) means 'not equal to'. It is used when you want every row except the ones matching a specific value.

Interactive Data

Products table

Use this dataset throughout the lesson to see how different operators filter the same set of rows.

8
PRODUCTS
2
CATEGORIES
₹50,000
MAX PRICE
product_idproductcategorypricestock
101LaptopElectronics₹50,00012
102MouseElectronics₹1,2000
103ChairFurniture₹8,00025
104DeskFurniture₹15,0004
105KeyboardElectronics₹2,50018
106MonitorElectronics₹18,0007
107LampFurniture₹90040
108TabletElectronics₹22,0000

Learn by Seeing

Exclude one category

SELECT product, category

FROM Products

WHERE category <> 'Electronics';

Only rows where category is NOT Electronics are returned.

Chair — Furniture
Desk — Furniture
Lamp — Furniture

Interactive Activity

How many products are NOT in the Electronics category?

Hint: Count the Furniture products.

SQL Analyst Mindset

Every operator changes which rows qualify

Real business questions often need more than one condition. Choosing the right combination of operators — <>, >, NOT IN, LIKE, IS NULL — is what turns a vague request into a precise query.

01

Understand

What does "exclude" or "match" mean in business terms?

02

Pick

Which operator expresses the rule precisely?

03

Combine

Use AND / OR with parentheses.

04

Validate

Do the returned rows match the business intent?

Lesson Summary

What you learned

<> / !=

Exclude a specific value.

NOT IN / NOT BETWEEN

Exclude a list or a range.

LIKE

Match text patterns using wildcards.

IS NULL / IS NOT NULL

Detect missing values in a column.

SQL Learning Support

SQL Operators & Conditions FAQs