開始使用免費開始

調整會員價格

業務開發團隊正在考慮調整會員價格。他們請你建立幾種不同的方案並提供結果。在這個練習中,你就要來完成這件事!

本練習屬於課程

Snowflake 的資料型別與函式

檢視課程

練習說明

  • 更新 SELECT 敘述,加入一個新欄位,對現有的 price_per_month 加上 25% 的調漲。
  • 建立名為 plus_five_dollars 的新欄位,對 sp 資料表中的 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;
編輯並執行程式碼