SQL Min and Max

The SQL Min and Max functions are used to return the smallest and largest values from a specific column, respectively. […]

The SQL Min and Max functions are used to return the smallest and largest values from a specific column, respectively. These functions are useful when you need to find the extreme values in you dataset.

SQL Min and Max Syntax

SQL




Tutorials dojo strip

SQL Min and Max Example

SQL Min and Max Finding the Oldest and Yougest Patients Example

This query reteieves the earliest (oldest patient) and the last (youngest patient) birthdates from the Patients table using the Min and Max functions.

SQL



SQL Min and Max Finding the Lowest and Highest Dosages Example

This query finds the minimum and maximum dosage prescribed for ‘Ibuprofen’ from the Prescriptions table. The Min function returns the lowest doage, and the Max function returns the highest dosage.

SQL




SQL Min and Max Visual Diagram




SQL Min and Max Labs

Tutorials dojo strip