Lesson 10 of 10 · 55 min

Mini take-home: account health report

By the end of this lesson you can complete a SQL take-home assignment end to end: audit the data, write down assumptions, build the analysis as reusable CTE steps, and deliver a final result that ties back to every intermediate number.

The brief

> From: Head of Customer Success, Mizan Cloud > Subject: Account health snapshot for the January planning meeting > > We want to know, as of 31 December 2025, which paying customers are healthy and which need attention, and how much monthly revenue sits in each group. Please send the SQL, your assumptions and a short summary. Our rule of thumb: an account needs attention if it is behind on payment, if nobody has used the product in the last 30 days, or if it has an open high-priority support ticket. Accounts with at least five active users are healthy.

This is a typical take-home brief: one business question, a loose definition, and an expectation that you will make the rest precise. The six tasks below build the answer step by step; each task's query reuses the CTEs of the previous ones, exactly as you would structure the real submission.

How reviewers read a take-home

  1. Data audit first. Did you look for duplicates, test data and missing values before computing anything? Write down what you found.
  2. Assumptions, written. ‘Paying’ = which subscription rows? ‘Active user’ = which events, which 30 days? Each assumption is one line in your write-up and one comment in your SQL.
  3. Readable, layered SQL. One CTE per business concept (paying, activity, tickets, health) so that each can be checked on its own.
  4. Numbers that tie. The final summary's account count and MRR must equal the paying base from step 2. Reviewers check this first.
  5. A short conclusion with the headline number, two or three recommendations and the caveats.
Included with a Formula Quest membership

This lesson, its 6 graded exercises and every other Members lesson in SQL Quest come with a Formula Quest membership that includes SQL (Single Quest with SQL selected, Quest Trio including SQL, or Quest Unlimited), or with SQL access from your organization.

Free to everyone: all of SQL Foundations and Retrieving and Filtering Data, the first lesson of every track, the playground, the dataset library and the SQL reference. See free lessons