Color theme
0 day streak0 XPP1
SQLLearn mode
MISSION 1 OF 1

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 / 2 challenges
LEARN THE CONCEPT

Understand it, then try it.

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.

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.

Track the values line by line. Predict the result before running this example in your own editor.