SQL TRAINING · LESSON 2 OF 4 · 3 MIN READ

Filter records with WHERE

Translate a boundary condition into a comparison.

Understand the idea

WHERE filters rows according to a condition. A comparison such as score >= 75 keeps scores at or above the boundary. A query can choose only certain columns while also keeping only certain rows: these are separate decisions. Real SQL has many more expressions than the DigiSkill checker supports.

Work through it

Translate the question into a condition, then test a value below, at and above the boundary. The DigiSkill filtering task asks you to keep the displayed source order, so do not add a sort for that task. Real databases do not promise a particular result order without an explicit ORDER BY.

SEE IT IN CONTEXT

Worked example

SELECT name, score
FROM students
WHERE score >= 75;
Boundary checks: 74 excluded; 75 included; 76 included.

The comparison includes equality. This matters when the brief says “at least”. The browser exercise checks additional score datasets so hardcoded rows do not satisfy the task.

Common mistakes to avoid

  • Using > when 75 must be included.
  • Returning only today’s matching names by hand.
  • Assuming source order is guaranteed in every real database.

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 starter
About 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 ↗

YOUR LEARNING JOURNEY

Look how far you’ve come.

Your progress is saved in this browser. Clearing browser data removes it.

Manage saved progress

This removes your completed-challenge history from this browser.