Get startedGet started for free

Creating CTEs (II)

In this exercise, you will use a CTE to return all the information regarding the patient(s) with the maximum BloodPressure.

This exercise is part of the course

Intermediate SQL Server

View Course

Exercise instructions

  • Create a CTE BloodPressure that returns one column (MaxBloodPressure) which contains the maximum BloodPressure in the table.
  • Join this CTE (using an alias b) to the main table (Kidney) to return information about patients with the maximum BloodPressure.

Hands-on interactive exercise

Have a go at this exercise by completing this sample code.

-- Create the CTE
WITH ___ 
AS (___)

SELECT *
FROM Kidney a
-- Join the CTE  
___
___
Edit and Run Code