Course Content
Introduction to SQL
Introduction to SQL
Checking for a Range of Values
To check for a range of values, we should use the BETWEEN
operator. This operator requires two values: the start-value and the end-value of the range. Also, the AND
keyword should be placed between these values.
Here is the syntax for using the BETWEEN
operator:
Let's see an example:
SELECT name, population FROM country WHERE population BETWEEN 100000 AND 3000000;
Here is the country
table we are working with:
Swipe to show code editor
Write an SQL query that returns the name
, capital
, and population
columns from the country
table (please retrieve these columns in this order), for all countries with a population
between 6000000 and 80000000. Then sort the result by capital
from A to Z.
Thanks for your feedback!
Checking for a Range of Values
To check for a range of values, we should use the BETWEEN
operator. This operator requires two values: the start-value and the end-value of the range. Also, the AND
keyword should be placed between these values.
Here is the syntax for using the BETWEEN
operator:
Let's see an example:
SELECT name, population FROM country WHERE population BETWEEN 100000 AND 3000000;
Here is the country
table we are working with:
Swipe to show code editor
Write an SQL query that returns the name
, capital
, and population
columns from the country
table (please retrieve these columns in this order), for all countries with a population
between 6000000 and 80000000. Then sort the result by capital
from A to Z.
Thanks for your feedback!
Checking for a Range of Values
To check for a range of values, we should use the BETWEEN
operator. This operator requires two values: the start-value and the end-value of the range. Also, the AND
keyword should be placed between these values.
Here is the syntax for using the BETWEEN
operator:
Let's see an example:
SELECT name, population FROM country WHERE population BETWEEN 100000 AND 3000000;
Here is the country
table we are working with:
Swipe to show code editor
Write an SQL query that returns the name
, capital
, and population
columns from the country
table (please retrieve these columns in this order), for all countries with a population
between 6000000 and 80000000. Then sort the result by capital
from A to Z.
Thanks for your feedback!
To check for a range of values, we should use the BETWEEN
operator. This operator requires two values: the start-value and the end-value of the range. Also, the AND
keyword should be placed between these values.
Here is the syntax for using the BETWEEN
operator:
Let's see an example:
SELECT name, population FROM country WHERE population BETWEEN 100000 AND 3000000;
Here is the country
table we are working with:
Swipe to show code editor
Write an SQL query that returns the name
, capital
, and population
columns from the country
table (please retrieve these columns in this order), for all countries with a population
between 6000000 and 80000000. Then sort the result by capital
from A to Z.