PostgreSQL MIN() function is an aggregate function that returns the minimum value in a set of values.
SELECT MIN(amount) FROM payment;
The following query gets the smallest payment paid by each customer:
SELECT customer_id, MIN(amount) FROM payment GROUP BY customer_id;
Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.