Comparing displayed results with the source dataset means checking a query or report against the original table using counts, names and totals. It appears in practical tasks that ask you to prove or evidence that your results are correct.
This lesson closes database queries and reports and uses ideas from all four lessons before it. It also supports the evidence skills in the ICT practical task and evidence checker.
What is a reliable checking routine?
- Write down what the task expects before running anything: which records and roughly how many.
- Count the matching records directly in the source table.
- Run the query and compare the count.
- Compare names or IDs to find any extra or missing record.
- Check one total by adding the source values yourself.
- Spot-check one calculated value by hand.
Worked example
Using the invented Harbour Hill Clubs table from the module page.
Task: report all members with Fee total, sorted by name.
Step 1, expected: all 10 records. Fee total from the source: 4 at RM30 = 120, 3 at RM45 = 135, 3 at RM60 = 180, so 435.
Step 2, the report shows: 9 rows and a fee total of 375.
Step 3, difference: 10 - 9 = 1 record missing, and 435 - 375 = 60.
Step 4, find it: a RM60 member is missing. Robotics members Evan, Farah and Jia each pay 60, and scanning the names shows Jia is not in the report.
Step 5, cause: a leftover criterion Sessions > 5 was still switched on. Jia attended exactly 5 sessions, so she was filtered out.
Step 6, fix: remove the criterion and re-run. The report shows 10 rows and 435.
The total pointed straight to a RM60 record, which narrowed the search a lot.
The mistake to watch for
Trusting that a result is right because it looks tidy:
The report shows 9 rows, neatly sorted, so the student submits it.
No error message appeared, but one record was filtered out, and the total is RM60 short.
The correction is to run the routine above every time, even when time is short. Counting 10 records in the source takes seconds.
Check yourself
1. A query for Fee >= 45 should return how many records, and what is their fee total?
Show answer
Fee 45: Bella, Chen, Gopal. Fee 60: Evan, Farah, Jia. 6 records, total 3 * 45 + 3 * 60 = 135 + 180 = 315.
2. A query for Sessions > 10 shows five records. Is that right?
Show answer
No. More than 10 means 11 or 12: Bella (12), Dewi (11), Farah (12), Imran (12). That is 4 records. Hui has exactly 10 and is excluded. A five-record result probably used >= instead of >.
3. The average number of sessions across all members is shown as 9.2. Check it.
Show answer
Total sessions: 8 + 12 + 9 + 11 + 7 + 12 + 6 + 10 + 12 + 5 = 92. Then 92 / 10 = 9.2. The displayed value is correct.
Where this leads next
Put all five lessons together in the database queries and reports practice set. The read-only SQL practice lab gives you a bundled fictional database to compare against, and the mistake log and retest queue helps you track the slips you repeat.
A teacher can watch you check a report and point out the step you skip, in online one-to-one ICT tuition.