1. Learn
  2. /
  3. Courses
  4. /
  5. Data Types and Functions in Snowflake

Connected

Exercise

Identifying high-performers

What's more fun than a leaderboard? The operations team wants to use the data in the CORE_GYM schema to create a member leader board based on calories burned. To do this, they're leaning on you to generate a result set that combines the members and visits tables.

Instructions

100 XP
  • Using a CTE, create a temporary result set called flattened_members that retrieves the user_id, first name, and last name from the members table.
  • Define a second temporary result set called high_performers that returns all records in the visits table with a calories_burned > 500.
  • Join the flattened members output to high_performers on the user_id field.
Powered by Snowflake