Course Content
Introduction to SQL
Introduction to SQL
The WHERE Clause Operators
SQL supports a lot of conditional statements.
Let’s look at the examples:
This example lists all countries that have a population of less than 2424200:
SELECT name, population FROM country WHERE population < 2424200;
The following example retrieves all countries with a population less than or equal to 2424200:
SELECT name, population FROM country WHERE population <= 2424200;
The following example retrieves all non-Asian countries:
SELECT name, continent FROM country WHERE continent<>'Asia';
Task
Write an SQL query to retrieve the name
, population
, region
, and capital
columns from the country
table (please retrieve these columns in this order), returning only the countries with a region
named Southern Europe
.
Note
Please note that
Southern Europe
should be correctly capitalized, andsouthern europe
should not be the same. So, be careful and write it asSouthern Europe
.
Here's a short example of the country
table:
id | name | continent | region | surfacearea | capital | population |
1 | Japan | Asia | Eastern Asia | 377829 | Tokyo | 126714000 |
2 | Latvia | Europe | NULL | 64589 | Riga | 2424200 |
3 | Mexico | North America | Central America | 1958201 | Mexico City | 98881000 |
... | ... | ... | ... | ... | ... | ... |
15 | Malta | Europe | Southern Europe | 316 | Valletta | 380200 |
Thanks for your feedback!
The WHERE Clause Operators
SQL supports a lot of conditional statements.
Let’s look at the examples:
This example lists all countries that have a population of less than 2424200:
SELECT name, population FROM country WHERE population < 2424200;
The following example retrieves all countries with a population less than or equal to 2424200:
SELECT name, population FROM country WHERE population <= 2424200;
The following example retrieves all non-Asian countries:
SELECT name, continent FROM country WHERE continent<>'Asia';
Task
Write an SQL query to retrieve the name
, population
, region
, and capital
columns from the country
table (please retrieve these columns in this order), returning only the countries with a region
named Southern Europe
.
Note
Please note that
Southern Europe
should be correctly capitalized, andsouthern europe
should not be the same. So, be careful and write it asSouthern Europe
.
Here's a short example of the country
table:
id | name | continent | region | surfacearea | capital | population |
1 | Japan | Asia | Eastern Asia | 377829 | Tokyo | 126714000 |
2 | Latvia | Europe | NULL | 64589 | Riga | 2424200 |
3 | Mexico | North America | Central America | 1958201 | Mexico City | 98881000 |
... | ... | ... | ... | ... | ... | ... |
15 | Malta | Europe | Southern Europe | 316 | Valletta | 380200 |
Thanks for your feedback!
The WHERE Clause Operators
SQL supports a lot of conditional statements.
Let’s look at the examples:
This example lists all countries that have a population of less than 2424200:
SELECT name, population FROM country WHERE population < 2424200;
The following example retrieves all countries with a population less than or equal to 2424200:
SELECT name, population FROM country WHERE population <= 2424200;
The following example retrieves all non-Asian countries:
SELECT name, continent FROM country WHERE continent<>'Asia';
Task
Write an SQL query to retrieve the name
, population
, region
, and capital
columns from the country
table (please retrieve these columns in this order), returning only the countries with a region
named Southern Europe
.
Note
Please note that
Southern Europe
should be correctly capitalized, andsouthern europe
should not be the same. So, be careful and write it asSouthern Europe
.
Here's a short example of the country
table:
id | name | continent | region | surfacearea | capital | population |
1 | Japan | Asia | Eastern Asia | 377829 | Tokyo | 126714000 |
2 | Latvia | Europe | NULL | 64589 | Riga | 2424200 |
3 | Mexico | North America | Central America | 1958201 | Mexico City | 98881000 |
... | ... | ... | ... | ... | ... | ... |
15 | Malta | Europe | Southern Europe | 316 | Valletta | 380200 |
Thanks for your feedback!
SQL supports a lot of conditional statements.
Let’s look at the examples:
This example lists all countries that have a population of less than 2424200:
SELECT name, population FROM country WHERE population < 2424200;
The following example retrieves all countries with a population less than or equal to 2424200:
SELECT name, population FROM country WHERE population <= 2424200;
The following example retrieves all non-Asian countries:
SELECT name, continent FROM country WHERE continent<>'Asia';
Task
Write an SQL query to retrieve the name
, population
, region
, and capital
columns from the country
table (please retrieve these columns in this order), returning only the countries with a region
named Southern Europe
.
Note
Please note that
Southern Europe
should be correctly capitalized, andsouthern europe
should not be the same. So, be careful and write it asSouthern Europe
.
Here's a short example of the country
table:
id | name | continent | region | surfacearea | capital | population |
1 | Japan | Asia | Eastern Asia | 377829 | Tokyo | 126714000 |
2 | Latvia | Europe | NULL | 64589 | Riga | 2424200 |
3 | Mexico | North America | Central America | 1958201 | Mexico City | 98881000 |
... | ... | ... | ... | ... | ... | ... |
15 | Malta | Europe | Southern Europe | 316 | Valletta | 380200 |