Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Learn Challenge: Non-Europe Capitals Sort | Advanced Data Filtering
Introduction to SQL

book
Challenge: Non-Europe Capitals Sort

Here is the country table we are working with:

Task

Swipe to start coding

Write an SQL query to get the name, capital, and continent columns from the country table (please retrieve these columns in this order). These countries must be not from the Europe continent. Sort the result by the capital column.

Note

europe is not the same as Europe, so be careful and write: Europe correctly.

Solution

SELECT name, capital, continent
FROM country
WHERE NOT continent = 'Europe'
ORDER BY capital;

Everything was clear?

How can we improve it?

Thanks for your feedback!

Section 4. Chapter 6

Query ResultQuery Result
No query executed yet...

Ask AI

expand
ChatGPT

Ask anything or try one of the suggested questions to begin our chat

some-alt