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>
.
This exercise is part of the course
Data Types and Functions in Snowflake
Exercise instructions
- Use the appropriate function to join several text values together into a single message.
- Add the
calories_burned
from thevisits
table to the message. - Include the
workout_type
the member performed during their visit to the message, then alias the result asmessage
.
Hands-on interactive exercise
Have a go at this exercise by completing this sample code.
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;