Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Learn Using the OR operator | Advanced Data Filtering
Practice
Projects
Quizzes & Challenges
Quizzes
Challenges
/
Introduction to SQL (60/40)

bookUsing the OR operator

The OR operator is used to filter records based on more than one condition, like if you want to return all countries from Asia but also those from Europe.

Here is the syntax of using the OR operator:

SELECT columns
FROM table
WHERE column = 'first_option' OR column = 'second_option';

Let's look at the example:

123
SELECT name, population, continent, region FROM country WHERE continent = 'Asia' OR continent = 'Europe';
copy

1. Which SQL query correctly uses the OR operator to select countries from either Asia or Europe

2. Which query will return countries with population greater than 50 million or surface area less than 100000

question mark

Which SQL query correctly uses the OR operator to select countries from either Asia or Europe

Select the correct answer

question mark

Which query will return countries with population greater than 50 million or surface area less than 100000

Select the correct answer

Everything was clear?

How can we improve it?

Thanks for your feedback!

SectionΒ 4. ChapterΒ 3

Ask AI

expand

Ask AI

ChatGPT

Ask anything or try one of the suggested questions to begin our chat

bookUsing the OR operator

Swipe to show menu

The OR operator is used to filter records based on more than one condition, like if you want to return all countries from Asia but also those from Europe.

Here is the syntax of using the OR operator:

SELECT columns
FROM table
WHERE column = 'first_option' OR column = 'second_option';

Let's look at the example:

123
SELECT name, population, continent, region FROM country WHERE continent = 'Asia' OR continent = 'Europe';
copy

1. Which SQL query correctly uses the OR operator to select countries from either Asia or Europe

2. Which query will return countries with population greater than 50 million or surface area less than 100000

question mark

Which SQL query correctly uses the OR operator to select countries from either Asia or Europe

Select the correct answer

question mark

Which query will return countries with population greater than 50 million or surface area less than 100000

Select the correct answer

Everything was clear?

How can we improve it?

Thanks for your feedback!

SectionΒ 4. ChapterΒ 3
some-alt