SQL Min and Max
Aggregate Functions
There are functions in SQL that returns single line result among a group of the rows. These functions are called aggregate functions.
MIN() and MAX() functions return the minimum and maximum result from the query, and this is always a single line.
Let's find the release date of the oldest song in our table:
1SELECT MIN(year) FROM songs
Now, let's select the price
of the most expensive song of 21st century:
12SELECT MAX(price) FROM songs WHERE year > 2000
Swipe to start coding
Find the price
of the most expensive song.
Lösung
Danke für Ihr Feedback!
single
Fragen Sie AI
Fragen Sie AI
Fragen Sie alles oder probieren Sie eine der vorgeschlagenen Fragen, um unser Gespräch zu beginnen
Zusammenfassen Sie dieses Kapitel
Code in file erklären
Erklären, warum file die Aufgabe nicht löst
Awesome!
Completion rate improved to 4.17
SQL Min and Max
Swipe um das Menü anzuzeigen
Aggregate Functions
There are functions in SQL that returns single line result among a group of the rows. These functions are called aggregate functions.
MIN() and MAX() functions return the minimum and maximum result from the query, and this is always a single line.
Let's find the release date of the oldest song in our table:
1SELECT MIN(year) FROM songs
Now, let's select the price
of the most expensive song of 21st century:
12SELECT MAX(price) FROM songs WHERE year > 2000
Swipe to start coding
Find the price
of the most expensive song.
Lösung
Danke für Ihr Feedback!
Awesome!
Completion rate improved to 4.17single