What is grouping?
Grouping - is arranging observations into sub-groups based on unique values in some column. For example, we can group our audi_cars
table by transmission
column (contains 3 unique values). There will be observations within each subgroup. So, what's the point of grouping?
In SQL grouping is often used in pair with some aggregate function within SELECT
. For example, we can calculate the average price
for each transmission
type.
123SELECT AVG(price), transmission FROM audi_cars GROUP BY transmission
This will return all the transmissions types with average prices within each group.
Swipe to start coding
From the audi_cars
table calculate the average price
of each model
. Round price to two decimals.
Рішення
Дякуємо за ваш відгук!
single
Запитати АІ
Запитати АІ
Запитайте про що завгодно або спробуйте одне із запропонованих запитань, щоб почати наш чат
Awesome!
Completion rate improved to 2.63Awesome!
Completion rate improved to 2.63
What is grouping?
Grouping - is arranging observations into sub-groups based on unique values in some column. For example, we can group our audi_cars
table by transmission
column (contains 3 unique values). There will be observations within each subgroup. So, what's the point of grouping?
In SQL grouping is often used in pair with some aggregate function within SELECT
. For example, we can calculate the average price
for each transmission
type.
123SELECT AVG(price), transmission FROM audi_cars GROUP BY transmission
This will return all the transmissions types with average prices within each group.
Swipe to start coding
From the audi_cars
table calculate the average price
of each model
. Round price to two decimals.
Рішення
Дякуємо за ваш відгук!
single
Awesome!
Completion rate improved to 2.63
What is grouping?
Свайпніть щоб показати меню
Grouping - is arranging observations into sub-groups based on unique values in some column. For example, we can group our audi_cars
table by transmission
column (contains 3 unique values). There will be observations within each subgroup. So, what's the point of grouping?
In SQL grouping is often used in pair with some aggregate function within SELECT
. For example, we can calculate the average price
for each transmission
type.
123SELECT AVG(price), transmission FROM audi_cars GROUP BY transmission
This will return all the transmissions types with average prices within each group.
Swipe to start coding
From the audi_cars
table calculate the average price
of each model
. Round price to two decimals.
Рішення
Дякуємо за ваш відгук!