Skip to content

Commit 20f8e65

Browse files
authored
Update Solution.md
1 parent 36cb7ed commit 20f8e65

File tree

1 file changed

+9
-11
lines changed

1 file changed

+9
-11
lines changed

Case Study #3 - Foodie-Fi/Solution.md

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
Danny realised that he wanted to create a new streaming service that only had food related content - something like Netflix but with only cooking shows!
66
Danny finds a few smart friends to launch his new startup Foodie-Fi in 2020 and started selling monthly and annual subscriptions, giving their customers unlimited on-demand access to exclusive food videos from around the world!
7+
78
This case study focuses on using subscription style digital data to answer important business questions.
89

910
Full description: [Case Study #3 - Foodie-Fi](https://8weeksqlchallenge.com/case-study-3/)
@@ -182,16 +183,10 @@ SELECT
182183
plan_name,
183184
COUNT(plan_name) AS number_of_churned_customers,
184185
ROUND(
185-
(
186-
COUNT(plan_name) / customers :: numeric * 100
187-
),
188-
1
186+
COUNT(plan_name) / customers :: numeric * 100
189187
) AS percentage_of_churned_after_trial,
190188
ROUND(
191-
(
192-
COUNT(plan_name) / churned_customers :: numeric * 100
193-
),
194-
1
189+
COUNT(plan_name) / churned_customers :: numeric * 100
195190
) AS churned_after_trial_to_all_churned
196191
FROM
197192
(
@@ -242,7 +237,7 @@ GROUP BY
242237

243238
| plan_name | number_of_churned_customers | percentage_of_churned_after_trial | churned_after_trial_to_all_churned |
244239
| --------- | --------------------------- | --------------------------------- | ---------------------------------- |
245-
| churn | 92 | 9.2 | 30.0 |
240+
| churn | 92 | 9 | 30 |
246241

247242
***92 customers have churned after their initial trial, it is 9% from all customers and 30% of all churned customers***
248243

@@ -718,7 +713,9 @@ The query creates a temporary table with 4448 rows. Here is a few rows from the
718713
| 20 | 1 | basic monthly | 2020-05-15 | 9.90 | 2 |
719714
| 20 | 3 | pro annual | 2020-06-05 | 189.10 | 3 |
720715

721-
### D. Outside The Box Questions
716+
### D. Outside The Box Questions
717+
718+
<details><summary> Click to expand :arrow_down: </summary>
722719

723720
The following are open ended questions which might be asked during a technical interview for this case study - there are no right or wrong answers, but answers that make sense from both a technical and a business perspective make an amazing impression!
724721

@@ -737,7 +734,7 @@ Let's calculate month over month grow using `lag()` window function:
737734
````sql
738735
SET
739736
search_path = foodie_fi;
740-
select
737+
SELECT
741738
DATE_TRUNC('month', start_date) AS month,
742739
COUNT(customer_id) AS current_number_of_customers,
743740
LAG(COUNT(customer_id), 1) over (
@@ -867,3 +864,4 @@ If a paying user churns then we can ask them about the reasons - why they decide
867864
And also send them some reminders from time to time.
868865

869866
How to validate: A/B tests, cohort analysis - number of active customers by date (retention day 7, retention day 30 etc.).
867+
</details>

0 commit comments

Comments
 (0)