Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Learn Using the AND Operator | Advanced Data Filtering
Introduction to SQL

book
Using the AND Operator

When you want to filter results using more than one column, you can chain conditions together with the AND operator in the WHERE clause.

SELECT name, population, region
FROM country
WHERE population >= 1000000 AND continent ='Europe';
123
SELECT name, population, region FROM country WHERE population >= 1000000 AND continent ='Europe';
copy

This query returns only the rows that meet both conditions: the country's population is at least 1000000, and it's located in Europe.

Task

Swipe to start coding

From the country table, retrieve only countries' names (column name) from Asia (can be checked in column continent) with a population greater than 1000000 (can be checked in column population).

Solution

SELECT name
FROM country
WHERE population > 1000000 AND continent ='Asia';
Everything was clear?

How can we improve it?

Thanks for your feedback!

Section 4. Chapter 1

Query ResultQuery Result
No query executed yet...

Ask AI

expand
ChatGPT

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

We use cookies to make your experience better!
some-alt