Table 1 shows part of a Students table that a school has created.
Table 1
| StudentID | FirstName | LastName | DateOfBirth |
|---|---|---|---|
| 1225 | William | Smith | 15/04/2009 |
| 1226 | Sid | Chopra | 04/11/2008 |
| 1227 | Freddie | Brown | 28/01/2009 |
| 1228 | William | Jones | 13/09/2008 |
Students table.
StudentID
Table 2 shows part of a Grades table in a school's database.
Table 2
| StudentID | Subject | Percentage | Grade |
|---|---|---|---|
| 1225 | Maths | 78 | 8 |
| 1227 | Computer Science | 61 | 6 |
| 1226 | Chemistry | 94 | 9 |
| 1227 | Chemistry | 81 | 8 |
| 1228 | Geography | 69 | 7 |
Varchar
Table 1 shows part of a Students table that a school has created.
Table 1
| StudentID | FirstName | LastName | DateOfBirth |
|---|---|---|---|
| 1225 | William | Smith | 15/04/2009 |
| 1226 | Sid | Chopra | 04/11/2008 |
| 1227 | Freddie | Brown | 28/01/2009 |
| 1228 | William | Jones | 13/09/2008 |
Table 2 shows part of a Grades table in the same database.
Table 2
| StudentID | Subject | Percentage | Grade |
|---|---|---|---|
| 1225 | Maths | 78 | 8 |
| 1227 | Computer Science | 61 | 6 |
| 1226 | Chemistry | 94 | 9 |
| 1227 | Chemistry | 81 | 8 |
| 1228 | Geography | 69 | 7 |
StudentID,
FirstName, LastName,
Subject, and Percentage
of any record in the Grades table with a score of at least 70%.
The results should be sorted by surname, A to Z.
SELECT FirstName,
LastName, Subject,
Percentage
FROM Students,
Grades
WHERE
Students.StudentID =
Grades.StudentID
AND Percentage >=
70
ORDER BY LastName
ASC