What burns more calories?
You're interesting in uncovering a bit of high-level information around workouts. Values like the total and average number of calories burned could provide insight to gym members who are looking to get the most out of their workouts. Luckily, you have the tools to do so!
Cet exercice fait partie du cours
Data Types and Functions in Snowflake
Instructions
- Find the total sum of
calories_burnedfor eachworkout_type. - Define a new column that stores the average number of
calories_burnedfor eachworkout_type. - Create a column that stores the average number of
calories_burned, rounded to two decimal places. - Aggregate the records by
workout_typeto ensure an error is not thrown.
Exercice interactif pratique
Essayez cet exercice en complétant cet exemple de code.
SELECT
workout_type,
-- Find the total number of calories burned
___ AS total_calories_burned,
-- Store the average calories burned
___ AS avg_calories_burned,
-- Round the average calories burned to 2 decimal points
___(___, ___) AS rounded_avg_calories_burned
FROM CORE_GYM.visits
-- Aggregate records by workout_type
___;