LoslegenKostenlos starten

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>.

Diese Übung ist Teil des Kurses

<Kurs>Data Types and Functions in Snowflake</Kurs>
Kurs ansehen

Übungsanweisungen

  • 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.

Interaktive praktische Übung

Versuche dich an dieser Übung, indem du diesen Beispielcode vervollständigst.

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 bearbeiten und ausführen