← VCE Spreadsheets, SQL & Visualisation

SQL SELECT and FROM

SELECT lists the fields to show and FROM names the table. This returns the name and age columns for every record in students. SELECT * shows all columns. End with a semicolon.

Understanding SQL SELECT and FROM in VCE Spreadsheets, SQL & Visualisation

What it does: SELECT lists the fields to show (title, year) separated by a comma, and FROM names the movies table. The statement ends with a semicolon. The asterisk * is the wildcard that means all columns. 'all' is not valid here. With no WHERE condition, the query returns the chosen columns for every record in the table. A semicolon marks the end of the statement. A full stop is not used. FROM must come before the table name. Without it the query is incomplete and will give an error. When you list more than one field after SELECT, you must separate them with commas, otherwise SQL can't tell them apart.

Common mistakes: FROM is spelled wrong. The keyword that names the table is FROM, so the line should be FROM students;. The statement is missing its semicolon. A SELECT statement should end with ; so the line should be FROM students;.

Class: _____________________  ·  Name: _____________________  ·  Date: _________

Free printable worksheet with full answer key — or add this module to a class and your students practise it interactively.

This module's key terms are also in a printable crossword (Modules 45–54) and word search (Modules 35–54).

Take this worksheet further — free with Cloodit

Each concept is reinforced from every angle — learned, then applied, then tested.

Learning
Duo
Which query shows only the name and age columns from the students table?
SELECT name, age FROM students;FROM students SELECT name, age;
Matches
SELECT name, age students;
↓
The FROM keyword is missing, so SQL doesn't know which table to read. It should be SELECT name, age FROM students;
Applying
Meanings
Term
SELECT name, age FROM students;
Meaning
SELECT lists the fields to show and FROM names the table. This returns the name and age columns for every record in students. SELECT * shows all columns. End with a semicolon.
Practice
SELECT name, age FROM students;
Testing
Gaps
name, age FROM students;
Check Answer
Spots
3SELECT *
4FORM students;

Cloodit turns curriculum-aligned coding content into journeys students work through one biome at a time.

The 'Owl' badge — Wise Coder, one of Cloodit's 106 collectible badges
Students earn collectable badges

Over 100 of them, across seven natural biomes.

Study Buddy
Students build a real study resource

Turns their work into revision material ready for Flash Cards and Exam study.

Diamond Dash — one of Cloodit's live, competitive Sprint games
Students lock in with Sprints

Live, competitive practice for the start of the lesson or a teacher-led lesson finisher.

A Cloodit certificate of achievement, ready to personalise and print
Custom printable certificates

Honour your top performers, or encourage a student who's trying hard — ready to print in seconds.

Quick Questions

1. Which query shows only the name and age columns from the students table?
A. FROM students SELECT name, age;
B. SELECT name, age FROM students; ✓
SELECT comes first and lists the fields to show. FROM then names the table to take them from.
2. In SELECT name, age FROM students; what does FROM students do?
A. It lists the columns to display
B. It names the table the data comes from ✓
FROM names the table. The columns to display are listed after SELECT.
3. Which query shows every column for every record in the students table?
A. SELECT * FROM students; ✓
B. SELECT all FROM students;
The asterisk * is the wildcard that means all columns. 'all' is not valid here.
4. Which query is written correctly?
A. SELECT name FROM students; ✓
B. SELECT name students FROM;
The field list goes after SELECT, and the table name must come straight after FROM.
5. What does SELECT name, age FROM students; return?
A. The name and age of every student record ✓
B. Only the first student's name and age
With no WHERE condition, the query returns the chosen columns for every record in the table.

Match the Pairs

SELECT name, age FROM students; → Shows only the name and age columns for every record in the students table
SELECT * FROM students; → Shows all columns for every record in the students table
Get just the title and year fields from a table called movies → SELECT title, year FROM movies;
A SQL statement should end with a semicolon to mark where it finishes → SELECT * FROM teams;
SELECT name, age students; → The FROM keyword is missing, so SQL doesn't know which table to read. It should be SELECT name, age FROM students;
SELECT name age FROM students; → There is no comma between the field names. It should be SELECT name, age FROM students;

Key Term

SELECT name, age FROM students;
SELECT lists the fields to show and FROM names the table. This returns the name and age columns for every record in students. SELECT * shows all columns. End with a semicolon.

Fill in the Blanks

1. SELECT name, age FROM students;
Hint: Type the keyword that lists the fields (columns) to show.
2. SELECT name, age FROM students;
Hint: Type the keyword that names the table the data comes from.
3. SELECT * FROM students;
Hint: Type the symbol that means show all columns.
4. SELECT name, age FROM students;
Hint: Type the name of the table being queried.
5. SELECT name, age FROM students;
Hint: Type the second column to show: the field that stores how old each student is.

Spot the Error

Question 1
A SELECT name, age
B FROM students;
C SELECT *
D FORM students;
Line D — FROM is spelled wrong. The keyword that names the table is FROM, so the line should be FROM students;
Question 2
A SELECT name, email
B FROM students
C SELECT *
D FROM teachers;
Line B — The statement is missing its semicolon. A SELECT statement should end with ; so the line should be FROM students;
Question 3
A SELECT name, age
B FROM students;
C SELECT year_level house
D FROM students;
Line C — Fields in a SELECT list must be separated by a comma. It should be SELECT year_level, house
Question 4
A SELECT *
B FROM students:
C SELECT name
D FROM students;
Line B — The statement ends with a colon. SQL statements end with a semicolon, so it should be FROM students;
Question 5
A SELECT title, author,
B FROM books;
C SELECT *
D FROM books;
Line A — There is an extra comma after the last field. Commas go between fields only, so it should be SELECT title, author

Student with a class code? Join your class →