MINimal and MAXimal values
Now it's time to talk about aggregate functions - functions that calculate some summary stats. Let's start with extremal summary stats - minimum and maximum values.
To find the minimum (or maximum) value in the column use MIN (or MAX) functions followed by column name. For example, we can find out the cheapest car with Automatic transmission.
123SELECT MIN(price) FROM audi_cars WHERE transmission = 'Automatic'
Please note, that unlike for
DISTINCTfunction you need to use parentheses forMINandMAXfunctions.
Swipe to start coding
From the audi_cars table find out the price of the most expensive Diesel car (fueltype column).
Solução
Obrigado pelo seu feedback!
single
Pergunte à IA
Pergunte à IA
Pergunte o que quiser ou experimente uma das perguntas sugeridas para iniciar nosso bate-papo
Resumir este capítulo
Explicar o código em file
Explicar por que file não resolve a tarefa
Awesome!
Completion rate improved to 2.63
MINimal and MAXimal values
Deslize para mostrar o menu
Now it's time to talk about aggregate functions - functions that calculate some summary stats. Let's start with extremal summary stats - minimum and maximum values.
To find the minimum (or maximum) value in the column use MIN (or MAX) functions followed by column name. For example, we can find out the cheapest car with Automatic transmission.
123SELECT MIN(price) FROM audi_cars WHERE transmission = 'Automatic'
Please note, that unlike for
DISTINCTfunction you need to use parentheses forMINandMAXfunctions.
Swipe to start coding
From the audi_cars table find out the price of the most expensive Diesel car (fueltype column).
Solução
Obrigado pelo seu feedback!
single