会員価格の調整
事業開発チームが会員価格の変更を検討しています。いくつかの選択肢を提示してほしいという依頼が来ました。この演習では、まさにその作業を行いましょう。
この演習はコースの一部です
Snowflake のデータ型と関数
演習の手順
SELECT文を更新して、既存のprice_per_monthに25%の値上げを加えた新しいフィールドを追加しましょう。spテーブルのprice_per_monthに$5.00を加えたplus_five_dollarsという新しい列を作成しましょう。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;