← VCE Spreadsheets, SQL & Visualisation

Matching part of a text value with wildcards

A query criterion where the * wildcard stands for any characters, so it finds text that starts with S. Like "*s" ends with s and Like "*at*" contains at.

Understanding Matching part of a text value with wildcards in VCE Spreadsheets, SQL & Visualisation

What it does: The * comes first to stand for any starting characters, and the s at the end means the text must finish with s. LIKE is used with a wildcard such as * to match part of the text, and B* matches any text that starts with B. The * goes after the S because any characters can follow the S. So Like "S*" finds Sam, Sofia and Shen. The letters a and t must appear together as at somewhere in the word. Tap has them in the wrong order and Cot has no a.

Common mistakes: The wildcard is on the wrong side. "*S" finds names that END with S. To find names that start with S, the criterion must be Like "S*". Fields in a SELECT list must be separated by a comma. It should be SELECT Name, Age.

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 criterion finds every name that STARTS with S?
Like "*S"Like "S*"
Matches
Like "*S" to find names that start with S
↓
The * is on the wrong side. Like "*S" finds names that END with S. To find names that start with S, put the * after the letter: Like "S*".
Applying
Meanings
Term
Like "S*"
Meaning
A query criterion where the * wildcard stands for any characters, so it finds text that starts with S. Like "*s" ends with s and Like "*at*" contains at.
Practice
Like "*at*"
Testing
Gaps
Criteria: "S*"
Check Answer
Spots
2SELECT Name FROM Students
3WHERE Name Like "*S";

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

The 'Manta Ray' badge — Graceful 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 criterion finds every name that STARTS with S?
A. Like "S*" ✓
B. Like "*S"
The * goes after the S because any characters can follow the S. So Like "S*" finds Sam, Sofia and Shen.
2. Which criterion finds every word that ENDS with s?
A. Like "*s" ✓
B. Like "s*"
The * goes before the s because any characters can come before it. Like "*s" finds Cats and Dogs.
3. Which criterion finds every pet name that CONTAINS the letters at anywhere inside it?
A. Like "at*"
B. Like "*at*" ✓
A * on both sides lets any characters come before and after at. Like "*at*" finds Cat, Bat and Matt. Like "at*" only finds names that start with at.
4. What does the * wildcard stand for in a query criterion?
A. Only the letter S
B. Any characters, including none ✓
The * is a stand-in for any characters, so it can match many different text values.
5. Which query criterion is written correctly to find text starting with B?
A. Like "B*" ✓
B. = "B*"
The LIKE operator tells the query to treat * as a wildcard. Without Like, the query looks for the exact text B*.

Match the Pairs

Like "S*" → Finds text that starts with S, such as Sam, Sydney or Soccer
Like "*at*" → Finds text that contains the letters at anywhere, such as cat, atlas or Matt
Find names that end with the letter s, like Chris or James → Like "*s"
The LIKE operator lets a query match part of a text value using a wildcard, for example all towns starting with B → Like "B*"
Like "*S" to find names that start with S → The * is on the wrong side. Like "*S" finds names that END with S. To find names that start with S, put the * after the letter: Like "S*".
= "S*" to find names that start with S → Wildcards only work with the LIKE operator. Using = looks for the exact text S* instead. It should be Like "S*".

Key Term

Like "S*"
A query criterion where the * wildcard stands for any characters, so it finds text that starts with S. Like "*s" ends with s and Like "*at*" contains at.

Fill in the Blanks

1. Field: Name Criteria: Like "S*"
Hint: Type the keyword that tells a query to match a pattern of text.
2. Field: Name Criteria: Like "S*"
Hint: Type the wildcard that stands for any characters after the S, so names starting with S are found.
3. Field: Name Criteria: Like "*s"
Hint: Type the wildcard that allows any characters before the last letter, to find text that ends with s.
4. Field: Pet Criteria: Like "*at*"
Hint: Type the wildcard that allows any characters after the letters, so the text can contain them anywhere.
5. SELECT * FROM Pets WHERE Name LIKE 'S%'
Hint: Type the SQL wildcard symbol that stands for any characters after the S.

Spot the Error

Question 1
A -- Names that start with S
B SELECT Name FROM Students
C WHERE Name Like "*S";
Line C — The wildcard is on the wrong side. "*S" finds names that END with S. To find names that start with S, the criterion must be Like "S*".
Question 2
A SELECT Name Age
B FROM Pets
C WHERE Name Like "C*";
Line A — Fields in a SELECT list must be separated by a comma. It should be SELECT Name, Age.
Question 3
A -- Titles ending with ing
B SELECT Title FROM Songs
C WHERE Title Like "ing*";
D ORDER BY Title;
Line C — "ing*" finds titles that START with ing. To find titles that end with ing, put the wildcard first: Like "*ing".
Question 4
A SELECT Name FROM Teams
B WHERE Name = "*ers";
C ORDER BY Name;
Line B — The = operator looks for the exact text *ers, so the * is not treated as a wildcard. Use Like "*ers" to find names ending in ers.
Question 5
A SELECT Name FROM Players
B WHERE Name Like *a*;
C ORDER BY Name;
Line B — The Like pattern is text, so it must be inside quotes. It should be Like "*a*" to find names containing a.

Student with a class code? Join your class →