멤버십 가격 조정
사업 개발 팀이 멤버십 가격 변경을 검토하고 있어요. 여러 가지 대안을 계산해 결과를 제시해 달라고 요청했어요. 이 예제에서 바로 그 작업을 해 보겠습니다!
이 연습은 강의의 일부입니다
Snowflake의 데이터 타입과 함수
연습 안내
- 기존
price_per_month에 25% 인상을 적용한 새 필드를SELECT문에 추가하세요. 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;