Smallest and largest: MIN and MAX
Find the extremes of a column.
MIN(column) gives the smallest value and MAX(column) the largest. They work on numbers, text (alphabetical order) and dates written as YYYY-MM-DD. You can put several aggregates in one SELECT to get a quick summary of a column.
SELECT MIN(price), MAX(price) FROM products;One row: the lowest price and the highest price in the shop.
MIN and MAX give the value, not the row it came from. MAX(price) tells you 60, not that it is the Wool Blanket. To get the whole row, sort with ORDER BY and use LIMIT 1, or use a subquery (later in this course).