Queries with derived tables (II)
In this exercise, you will create a derived table to return all patient records with the highest BloodPressure at their Age level.```
```
Latihan ini adalah bagian dari kursus
Intermediate SQL Server
Petunjuk latihan
- Create a derived table
- returning
AgeandMaxBloodPressure; the latter is the maximum ofBloodPressure. - is taken from the
kidneytable. - is grouped by
Age.
- returning
- Join the derived table to the main query on
- blood pressure equal to max blood pressure.
- age.
Latihan interaktif praktis
Cobalah latihan ini dengan menyelesaikan kode contoh berikut.
SELECT *
FROM Kidney a
-- Create derived table: select age, max blood pressure from kidney grouped by age
JOIN (___) b
-- JOIN on BloodPressure equal to MaxBloodPressure
ON ___
-- Join on Age
AND ___