Finding errors
In the example on the previous page, the predicted result and actual result do not match.
When this happens, it is necessary to go back to the design and implementation phases to try to identify the error.
Design
Query Design: Return a list of all pupils who are members of the Orchestra and receive tuition
| Field(s) | First Name, Surname, Tuition |
| Table(s) | Pupil, Orchestra |
| Criteria | Tuition = True |
| Sort Order | Surname DESC |
| Field(s) |
| First Name, Surname, Tuition |
| Table(s) |
| Pupil, Orchestra |
| Criteria |
| Tuition = True |
| Sort Order |
| Surname DESC |
The design for the query is fine.
Implementation
A mistake has been made during implementation.
The query will return the pupils who do not receive tuition. The database developer has accidentally entered ‘No’ instead of ‘Yes’. The SQL code should have read:
SELECT Pupil.First Name, Pupil.Surname, Orchestra.TuitionFROM OrchestraINNER JOIN Pupil ON Orchestra.PupilID = Pupil.PupilID WHERE Orchestra.Tuition = ‘Yes’ORDER BY Pupil.Surname DESC;This would return:
| First Name | Surname | Tuition |
| James | McNamee | Yes |
| Tabiso | Matazinadze | Yes |
| First Name | James |
|---|---|
| Surname | McNamee |
| Tuition | Yes |
| First Name | Tabiso |
|---|---|
| Surname | Matazinadze |
| Tuition | Yes |
Now that the actual result matches the predicted result, testing is complete for this query.