SQL SELECT

Read rows from a table.

SQL
SELECT name, score
FROM students
WHERE score >= 80
ORDER BY score DESC;

Explanation

SELECT names the columns to return. WHERE filters rows. ORDER BY controls their order.

Explore the dry run
Guided walkthroughReady
1SELECT name, score
2FROM students
3WHERE score >= 80
4ORDER BY score DESC;

Follow the example

Start to inspect the source, values, and output. These prepared steps explain the published sample; grouped loop steps describe multiple iterations.

View the complete dry-run table
Prepared trace of the published program. Some rows group repeated iterations.
Step / lineWhat happensState after stepOutput so far
Request the name and score columns.—
—
Read rows from students.—
—
Keep only rows whose score is at least 80.—
—
Sort the remaining rows by score, highest first. Actual rows depend on table data.—
—