调整会员价格
业务拓展团队正在考虑调整会员价格。他们希望您构建几种不同的定价方案并给出结果。在这个练习中,您将完成这一任务。
本练习是课程的一部分
Snowflake 中的数据类型与函数
练习说明
- 更新
SELECT语句,新增一个字段,在当前price_per_month基础上增加 25% 的涨幅。 - 在
sp表中创建名为plus_five_dollars的新列,为price_per_month增加$5.00。 - 再创建一个新列,将
price_per_month除以2,并将该列命名为half_off。
交互式实操练习
通过完成这段示例代码来试试这个练习。
SELECT
m.user_id,
m.sign_up_date,
m.subscription_plan,
sp.price_per_month AS original_price,
-- Add a 25% uplift to the existing price per month
___ * 1.25 AS twenty_five_percent_uplist,
-- Increase the price_per_month by $5.00
___ ___ ___ AS ___,
-- Divide the price per month by 2
___
FROM CORE_GYM.subscription_plans AS sp
JOIN CORE_GYM.members AS m
ON sp.subscription_plan = m.subscription_plan;