This site runs best with JavaScript enabled.Lesson 7: Filtering results using the WHERE Clause and the OR operator.

Lesson 7: Filtering results using the WHERE Clause and the OR operator.


Leveling up our WHERE clause with OR.

In the WHERE clause we can also tailor our results by joining conditions where EITHER of them can be met by using the OR operator.

Maybe I'm not quite so worried about the particular holiday destination and am open to available suggestions on the type of holiday I’m looking for. I’d quite like to visit a European country that I know to have a hot climate during the summer months.

For example,

SELECT *
FROM Holidays
WHERE Country='Spain' OR Country='Portugal' OR Country='Greece';

Quiz Time.

The Question.

We're not being picky on gender this time but Nick Fury has been specific about the hair colour he wants to see.

Bring back all rows where the character has either black OR brown hair.

The Data.

The Editor.



The Answer.

Correct SQL:

Correct Output:

Share lesson