SQL TRAINING · LESSON 1 OF 4 · 3 MIN READ
Choose columns with SELECT
Separate the columns you want from the table you read.
Understand the idea
A table contains rows and named columns. SELECT describes the columns to return, while FROM identifies the source table. Choosing the needed columns makes the result easier to understand than returning everything without a reason. SQL is a language for working with data; this training uses a limited read-only practice subset.
Work through it
Read the table name and column names before writing a query. List the requested columns in the requested order, separated by commas. This first step selects columns; the following lesson adds a row filter. The linked practice activity combines both steps.
SEE IT IN CONTEXT
Worked example
SELECT name, score FROM students;
The query returns the name and score columns. It does not filter by score yet. The practice task asks for a specific score condition, so this query alone is only a starting point.
Common mistakes to avoid
- Confusing a table name with a column name.
- Forgetting the comma between selected columns.
- Assuming selecting columns also filters rows.
NOW HAVE A GO
Find students scoring at least 75
Apply the idea in the linked activity. Follow its own brief and values; examples in this lesson are illustrative.
Try the practice activity →Download the practice starterAbout the linked activity
DigiSkill has two SQL practice activities and a focused browser checker: SELECT name, score FROM students, numeric WHERE comparisons, ORDER BY score ASC/DESC and LIMIT. Lessons build toward those two activities. No live database, JOIN, GROUP BY or writes are included.
Reading marks are self-reported and saved only in this browser.
0 of 4 lessons marked as read
Keep learning: Reference documentation ↗
