SQL COUNT function
SQL function that counts records. SELECT COUNT(*) FROM Students; outputs one row with the number of records in the table. It counts rows, whereas SUM adds up values.
Understanding SQL COUNT function in IGCSE Computer Science Paper 2
What it does: COUNT(*) gives the number of records in the table as one row of output. SUM adds the values together, whereas COUNT only counts how many records there are. The clause order must be SELECT, FROM, then WHERE. FROM must come before WHERE. COUNT is a function, so the * must be inside brackets: COUNT(*). The correct statement is SELECT COUNT(*) FROM Students; because FROM names the table.
Common mistakes: The closing bracket is missing from the COUNT function. It should be SELECT COUNT(*). SQL uses a single = to compare values in a WHERE condition, not ==. It should be WHERE Year = 9;.
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 525–538) and word search (Modules 500–538).
Take this worksheet further — free with Cloodit
Each concept is reinforced from every angle — learned, then applied, then tested.
Cloodit turns curriculum-aligned coding content into journeys students work through one biome at a time.
Over 100 of them, across seven natural biomes.
Turns their work into revision material ready for Flash Cards and Exam study.
Live, competitive practice for the start of the lesson or a teacher-led lesson finisher.
Honour your top performers, or encourage a student who's trying hard — ready to print in seconds.
Quick Questions
Match the Pairs
Key Term
COUNT(*)Fill in the Blanks
Spot the Error
Student with a class code? Join your class →