Select All Patients
Easy
Retrieve all columns from the patients table.
Filter by Province
Easy
Get first_name, last_name and city of patients from Ontario ('ON').
Distinct Cities
Easy
List unique city names from the patients table.
Sort by Height
Easy
List patients' first_name and height, sorted by height in descending order.
Nulls Last Sorting
Medium
List patients' first_name and allergies. Sort by allergies ascending, putting NULLs at the end.
Pattern Matching
Easy
Find patients whose first_name starts with 'J'.
Age Range with BETWEEN
Easy
Find patients born between 1980 and 1990 (inclusive).
Complex Filtering (IN)
Easy
Find patients who live in 'Toronto' or 'Montreal'.
BMI Category Case
Medium
Show first_name, weight, height, and a calculated column 'category' based on weight: >80 is 'Heavy', <60 is 'Light', else 'Medium'.
Patients with no city information
Medium
List patients (first_name, last_name) who do not have a city recorded (city IS NULL).
Heaviest Patient Per City
Hard
Show the city, patient's first_name, and their weight for the heaviest patient in each city.
Oldest Patients By Gender
Hard
For each gender, list the first_name and birth_date of the oldest patient(s).
Patients with Long Names
Hard
Show first_name and last_name of patients where the combined length exceeds 25 characters.