Color theme
0 day streak0 XPP1
SQLQuiz mode
MISSION 1 OF 3

Find open observatories

0 XP earned
SQL track: BeginnerMission: BeginnerRow filteringSELECT queriesOrdering
Before you start this beginner track

Tables, rows, and columns. Start with SELECT before grouped queries.

Guided code reading and debugging. Runnable coding challenges are available in JavaScript, Python, and SQL.

x
0 / 6 challenges
KNOWLEDGE CHECK

Predict the result.

Which names are returned, from top to bottom?

quest.sql
WITH sites(name, open_now) AS (    VALUES ('Mesa', 1), ('Delta', 0), ('Cedar', 1))SELECT nameFROM sitesWHERE open_now = 1ORDER BY name ASC;

Run each query independently in SQLite 3. VALUES inside a common table expression supplies all data, so no tables or database setup are needed. Quiz outputs show data rows only, with | between columns and no headers.

Review the lesson

An observatory directory stores a name and an open flag for each site. WITH gives the inline sample rows a temporary name for this query. SELECT chooses the output column, WHERE filters individual rows, and ORDER BY makes the remaining names appear in a predictable alphabetical order.

Choose your answer+25 XP on first completion