SELECT...FROM...WHERE...clause
To go a step further, the WHERE clause can be used. The WHERE clause will only return records that meet a specific condition.
SELECT PupilID, Surname, ClassFROM PupilWHERE Class = ‘1T1’;This would return
| PupilID | Surname | Class |
| 001 | Singh | 1T1 |
| 004 | McNamee | 1T1 |
| 007 | McNamee | 1T1 |
| 008 | Matazinadze | 1T1 |
| PupilID | 001 |
|---|---|
| Surname | Singh |
| Class | 1T1 |
| PupilID | 004 |
|---|---|
| Surname | McNamee |
| Class | 1T1 |
| PupilID | 007 |
|---|---|
| Surname | McNamee |
| Class | 1T1 |
| PupilID | 008 |
|---|---|
| Surname | Matazinadze |
| Class | 1T1 |
The WHERE clause has been used to ensure that the only records returned are those that have the value ‘1T1’ in the 'Class' column/field.