Section 1 - Instruction

Last time you learned pattern matching with LIKE. But what if you need multiple conditions? Like finding customers in California who spent over $100?

Single WHERE conditions aren't enough. You need to combine multiple criteria logically.

Engagement Message

When have you needed to filter data with multiple requirements at once?

Section 2 - Instruction

The AND operator lets you require ALL conditions to be true. Think of it as "this AND that AND the other thing."

SELECT * FROM customers WHERE state = 'CA' AND total_spent > 100;

This only returns California customers who spent over $100.

Engagement Message

What would happen if a customer spent $150 but lived in Texas?

Section 3 - Instruction

The OR operator finds rows where ANY condition is true. It's like saying "this OR that."

SELECT * FROM products WHERE category = 'Electronics' OR price < 50;

This returns electronics products AND cheap products (under $50).

Engagement Message

Would a $200 electronics item be included in these results?

Section 4 - Instruction

The NOT operator excludes rows that match a condition. It flips true to false.

SELECT * FROM orders WHERE NOT status = 'Cancelled';

This shows all orders except cancelled ones. Same as WHERE status <> 'Cancelled'.

Engagement Message

When would NOT be clearer than using <>?

Section 5 - Instruction

Comparison operators let you compare values: > (greater), < (less), >= (greater or equal), <= (less or equal), <> (not equal).

SELECT * FROM inventory WHERE quantity <= 5 AND reorder_level >= 10;

Sign up
Join the 1M+ learners on CodeSignal
Be a part of our community of 1M+ users who develop and demonstrate their skills on CodeSignal