Course Content
Introduction to SQL
Introduction to SQL
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. Here’s an example:
SELECT name, population, region FROM country WHERE population >= 1000000 AND continent ='Europe';
This query returns only the rows that meet both conditions: the country’s population is at least 1000000, and it’s located in Europe.
Here is the country
table we are working with:
Swipe to show code editor
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
).
Thanks for your feedback!
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. Here’s an example:
SELECT name, population, region FROM country WHERE population >= 1000000 AND continent ='Europe';
This query returns only the rows that meet both conditions: the country’s population is at least 1000000, and it’s located in Europe.
Here is the country
table we are working with:
Swipe to show code editor
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
).
Thanks for your feedback!