In PostgreSQL, the "MIN" and "MAX" functions are aggregate functions used to find the minimum and maximum values within a set of rows or a specific column in a table.
The "MIN" function is used to find the minimum value within a set of values. It can be applied to both numeric and non-numeric data types. When used in conjunction with a GROUP BY clause, it finds the minimum value for each group.
Example:
Find the minimum value in a column:
SELECT MIN(column_name) FROM table_name;
The "MAX" function is used to find the maximum value within a set of values, similar to MIN. It can be applied to both numeric and non-numeric data types. When used with GROUP BY, it finds the maximum value for each group.
Example:
Find the maximum value in a column:
SELECT MAX(column_name) FROM table_name;