Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Lernen Checking for a Range of Values | Section
Practice
Projects
Quizzes & Challenges
Quizze
Challenges
/
SQL Fundamentals
Abschnitt 1. Kapitel 24
single

single

bookChecking for a Range of Values

Swipe um das Menü anzuzeigen

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:

SELECT columns 
FROM table 
WHERE column BETWEEN value_from AND value_to;

Let's see an example:

123
SELECT name, population FROM country WHERE population BETWEEN 100000 AND 3000000;
copy
Aufgabe

Swipe to start coding

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.

Lösung

Switch to desktopWechseln Sie zum Desktop, um in der realen Welt zu übenFahren Sie dort fort, wo Sie sind, indem Sie eine der folgenden Optionen verwenden
War alles klar?

Wie können wir es verbessern?

Danke für Ihr Feedback!

Abschnitt 1. Kapitel 24
single

single

Fragen Sie AI

expand

Fragen Sie AI

ChatGPT

Fragen Sie alles oder probieren Sie eine der vorgeschlagenen Fragen, um unser Gespräch zu beginnen

some-alt