Aan de slagGa gratis aan de slag

Motivating member marketing

As part of a new effort to motivate gym members to come back, the marketing team is interested in creating notifications to share with members after a workout. Your job is to automate the creation of these messages so it can be quickly integrated into their app.

The message should look something like this: On <date> you burned <calories burned> calories via <workout type>.

Deze oefening maakt deel uit van de cursus

Data Types and Functions in Snowflake

Cursus bekijken

Oefeninstructies

  • Use the appropriate function to join several text values together into a single message.
  • Add the calories_burned from the visits table to the message.
  • Include the workout_type the member performed during their visit to the message, then alias the result as message.

Praktische interactieve oefening

Probeer deze oefening eens door deze voorbeeldcode in te vullen.

SELECT
    v.user_id,
    g.location,
    
    -- Concatenate the following strings to create a sentence
    ___(
        'Congrats! On ', 
        DATE(v.checkin_time), 
        ' you burned ', 
        v.___,  -- Add the calories burned
        ' calories via ', 
        v.___  -- Add the workout type
    ) AS message

FROM CORE_GYM.visits AS v
JOIN CORE_GYM.gyms AS g
    ON v.gym_id = g.gym_id;
Code bewerken en uitvoeren