始める無料で始める

会員価格の調整

事業開発チームが会員価格の変更を検討しています。いくつかの選択肢を提示してほしいという依頼が来ました。この演習では、まさにその作業を行いましょう。

この演習はコースの一部です

Snowflake のデータ型と関数

コースを見る

演習の手順

  • SELECT 文を更新して、既存の price_per_month に25%の値上げを加えた新しいフィールドを追加しましょう。
  • sp テーブルの price_per_month$5.00 を加えた plus_five_dollars という新しい列を作成しましょう。
  • price_per_month2 で割った値を持つ列をもう一つ作成し、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;
コードを編集して実行