Deals Of The Week - hours only!Up to 80% off on all courses and bundles.-Close
SQL Basics
Summary

Instruction

Very good! We can also use more than one condition in the WHERE clause. Take a look:

SELECT *
FROM employee
WHERE level < 3 OR level > 6;

The query above shows employees whose level is less than three OR whose level is greater than six. We used the keyword OR to join two conditions. In the same way, we can use AND:

SELECT *
FROM employee
WHERE level > 2 AND level < 5;

This time, we'll get employees whose level is greater than two and less than five at the same time (in other words, we'll get employees with levels 3 and 4).

Exercise

Okay, let's now gather all the requirements from the German couple.

Select all the information from the hotel table for hotels which aren't in Berlin, have more than 50 rooms and allow pets.

Stuck? Here's a hint!

Type:

SELECT *
FROM hotel
WHERE pets_allowed IS TRUE
  AND city != 'Berlin'
  AND room_count > 50;