ProgrammingTopic Summary

Knowledge Organiser: SQL

Part of SQL · GCSE GCSE Computer Science revision

This topic summary covers Knowledge Organiser: SQL within SQL for GCSE Computer Science. Revise SQL in Programming for GCSE Computer Science with 15 exam-style questions and 10 flashcards. This topic appears regularly enough that it should still be part of a steady revision cycle. It is section 9 of 9 in this topic. Use this topic summary to connect the idea to the wider topic before moving on to questions and flashcards.

Topic position

Section 9 of 9

Practice

15 questions

Recall

10 flashcards

Knowledge Organiser: SQL

Key Terms
  • SQL: Structured Query Language — used to query and manage databases
  • SELECT: Specifies which columns to retrieve
  • FROM: Specifies the table to query
  • WHERE: Filters rows by a condition
  • ORDER BY: Sorts the results (ASC = ascending, DESC = descending)
  • Wildcard (*): Selects all columns in a table
Must-Know Facts
  • SQL keyword order: SELECT ... FROM ... WHERE ... ORDER BY
  • String values in WHERE must be in quotes: WHERE city = "London"
  • Number values do not use quotes: WHERE age > 16
  • Use AND to require multiple conditions; use OR for either condition
  • SELECT * returns all columns; name specific columns to limit output
  • ASC sorts lowest to highest; DESC sorts highest to lowest
Key Concepts
  • Get all data: SELECT * FROM Students
  • Filter rows: SELECT name FROM Students WHERE age > 16
  • Sort results: ORDER BY score DESC
  • Multiple conditions: WHERE age >= 16 AND city = "London"
  • Memory aid: S-F-W-O — Select, From, Where, Order by
Common Mistakes
  • Getting the SQL keyword order wrong: The correct order is SELECT ... FROM ... WHERE ... ORDER BY — putting WHERE before FROM will cause a syntax error
  • Forgetting quotes around string values: String comparisons in WHERE require quotes: WHERE name = "Ali"; numeric comparisons do not: WHERE age > 16
  • Using = instead of > or < for numeric ranges: WHERE age = 16 only matches exactly 16; use >= or <= for ranges
  • Forgetting ORDER BY comes last: ORDER BY must appear after WHERE — placing it in the middle causes a syntax error
  • Confusing AND and OR in WHERE clauses: AND requires both conditions to be true; OR requires at least one — mixing them up produces incorrect results

Revise this topic interactively on PrepWise — self-test mode, tap-to-reveal definitions, and Common Mistakes from examiners.

Try the interactive Knowledge Organiser — free →

Keep building this topic

Read this section alongside the surrounding pages in SQL. That gives you the full topic sequence instead of a single isolated revision point.

Practice Questions for SQL

Which SQL keyword is used to choose which columns to retrieve from a database table?

  • A. FROM
  • B. WHERE
  • C. SELECT
  • D. ORDER BY
1 markfoundation

Explain the difference between using AND and OR to combine conditions in an SQL WHERE clause. Give an example of when each would be used.

3 marksstandard

Quick Recall Flashcards

What does WHERE do?
Filters rows based on conditions
What does SELECT do?
Chooses which columns to display

15 questions on SQL — practise free

Instant marking, adaptive difficulty, and 10 spaced repetition flashcards. Free until your GCSEs.

Try PrepWise Free