SQL Practice

GROUP BY

Summarise data within groups.

  1. 01Patients per city

    For each city, return the number of patients. Sort by city.

    easy
  2. 02Average height by gender

    Return the average height for each gender.

    medium
  3. 03Admission count per diagnosis

    Show each diagnosis and how many admissions have it, highest count first.

    medium
  4. 04Salary by specialty

    For each specialization, calculate average salary and show highest averages first.

    medium
  5. 05Admissions per diagnosis

    Count admissions per diagnosis with more than three admissions; show the largest counts first.

    medium
  6. 06Repeat customers

    Show customer ids and names for customers with at least two orders, plus their order counts. Sort by count descending then customer id.

    medium
← All practice topics