DataBolt

SQL LEARNING PLATFORM

2

CHAPTER 2

FILTERING - WHERE

WHERE filters which rows come back. Without it, you get every row.

5

Learning Blocks

SQL

Interactive Queries

In This Chapter

Concepts you'll master

1

Filtering rows with a single condition

2

All comparison operators: =, !=, >, <, >=, <=

3

Filtering numbers, text, and dates

🌟 Think of it this way: WHERE is the bouncer at the door. Only rows that satisfy the condition get through to your result. Everyone else it turned away.

4.1 - Basic Syntax

SQL QUERY
SELECT name, department, salary 
FROM employees
WHERE department = 'IT';

SQL QUERY
SELECT name, salary 
FROM employees
WHERE salary > 70000;

Exercise

Practice your SQL skills

SQL EDITOR
Press semicolon (;) to auto-run query

Tasks

Complete all SQL challenges

1

Find all employees who work in the IT department

Current Task
2

Find employees with salary greater than 60000.

3

Find employees who work in IT and earn more than 60000.

4

Find employees who are in HR or Marketing.

5

Find employees who do not have a manager.

Need help solving this task?