A database is fit for purpose if it meets the end use and functional requirements. Testing queries and examining actual output against expected output helps to determine fitness for purpose.
When testing queries, it is good practice to document expected results and actual results. A comparison can then be made, with testing passed if the expected result and actual result is the same.
In the example shown below, the design and implementation (SQL) are also shown to provide a clear context for the testing that follows.
The query being tested is designed to run on the data held in the following versions of the pupil and orchestra tables.
Pupil table
PupilID | First Name | Surname | Class | Pastoral Care Teacher | Merit Points |
---|---|---|---|---|---|
0001 | Zainab | Singh | 1T1 | Mr Harley | 74 |
0002 | David | Boland | 1I2 | Mrs Aitken | 12 |
0003 | Amy | Jones | 1M1 | Mr Gilchrist | 55 |
0004 | James | McNamee | 1T1 | Mr Harley | 88 |
0005 | Pawel | McTavish | 1I1 | Mrs Aitken | 19 |
0006 | Antonia | Gallagher | 1M2 | Mr Gilchrist | 21 |
0007 | Amy | McNamee | 1T1 | Mr Harley | 63 |
0008 | Aysha | Matazinadze | 1T1 | Mr Harley | 45 |
0009 | Beatrice | Panner | 1T2 | Mr Harley | 77 |
0010 | Thomas | Glacney | 1M1 | Miss Armstrong | 91 |
0011 | Frankie | Al-Robeye | 1M2 | Mr Gilchrist | 71 |
Orchestra table
OrchestraMemberID | PupilID | Group | Tuition |
---|---|---|---|
01 | 0004 | Woodwind | Yes |
02 | 0007 | Strings | No |
03 | 0008 | Brass | Yes |
04 | 0003 | Brass | No |
05 | 0009 | Percussion | No |