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

Contenido del Curso

Introduction to SQL

Using the AND OperatorUsing the AND Operator

To filter on multiple columns, you must use the AND operator to add conditions to the WHERE clause. Let's see an example:

This request retrieves only those rows that correspond to both conditions: countries where the population is greater than or equal to 1,000,000 and the continent is Europe.

Tarea

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). Please note you only need to output country names.

Here's a short example of the country table:

idnamecontinentregionsurfaceareacapitalpopulation
1JapanAsiaEastern Asia377829Tokyo126714000
2LatviaEuropeNULL64589Riga2424200
3MexicoNorth AmericaCentral America1958201Mexico City98881000
.....................
15MaltaEuropeSouthern Europe316Valletta380200

¿Todo estuvo claro?

Sección 4. Capítulo 1
toggle bottom row
course content

Contenido del Curso

Introduction to SQL

Using the AND OperatorUsing the AND Operator

To filter on multiple columns, you must use the AND operator to add conditions to the WHERE clause. Let's see an example:

This request retrieves only those rows that correspond to both conditions: countries where the population is greater than or equal to 1,000,000 and the continent is Europe.

Tarea

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). Please note you only need to output country names.

Here's a short example of the country table:

idnamecontinentregionsurfaceareacapitalpopulation
1JapanAsiaEastern Asia377829Tokyo126714000
2LatviaEuropeNULL64589Riga2424200
3MexicoNorth AmericaCentral America1958201Mexico City98881000
.....................
15MaltaEuropeSouthern Europe316Valletta380200

¿Todo estuvo claro?

Sección 4. Capítulo 1
toggle bottom row
some-alt