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.
0 of 8 concepts completed
Complete the activity and related MCQ to unlock the next concept.
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.
| product_id | product | category | price | stock |
|---|---|---|---|---|
| 101 | Laptop | Electronics | ₹50,000 | 12 |
| 102 | Mouse | Electronics | ₹1,200 | 0 |
| 103 | Chair | Furniture | ₹8,000 | 25 |
| 104 | Desk | Furniture | ₹15,000 | 4 |
| 105 | Keyboard | Electronics | ₹2,500 | 18 |
| 106 | Monitor | Electronics | ₹18,000 | 7 |
| 107 | Lamp | Furniture | ₹900 | 40 |
| 108 | Tablet | Electronics | ₹22,000 | 0 |
Learn by Seeing
Exclude one category
SELECT product, category FROM Products WHERE category <> 'Electronics';
Only rows where category is NOT Electronics are returned.
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.
Understand
What does "exclude" or "match" mean in business terms?
Pick
Which operator expresses the rule precisely?
Combine
Use AND / OR with parentheses.
Validate
Do the returned rows match the business intent?
Lesson Summary
What you learned
Exclude a specific value.
Exclude a list or a range.
Match text patterns using wildcards.
Detect missing values in a column.
SQL Learning Support