MulaiMulai sekarang secara gratis

Ranking gym members by efficiency

Now that you've created the calories_per_minute function, it's time to create the dataset for your development team. This is really going to put their app over the top!

Latihan ini adalah bagian dari kursus

Data Types and Functions in Snowflake

Lihat Kursus

Petunjuk latihan

  • Using the calories_per_minute function, determine the workout efficiency for each individual gym member using the visits table.
  • Alias the resulting column as workout_efficiency.
  • Sort the result set by workout_efficiency.

Latihan interaktif praktis

Cobalah latihan ini dengan menyelesaikan kode contoh berikut.

SELECT
    user_id,
    gym_id,
    checkin_time,

	-- Determine workout efficiency for each user using the check in/out
    -- time, as well as the number of calories burned
    ___(
        ___, 
        ___, 
        ___
    ) AS ___  -- Alias the results as workout_efficiency

FROM CORE_GYM.visits

-- Order the results by workout_efficiency
___ ___ ___ DESC;
Edit dan Jalankan Kode