Lesson 7 of 10 · 40 min

Business case questions

By the end of this lesson you can take an open business question (where do customers spend, which accounts are dormant, why do customers churn), define the metric precisely, handle the data's business traps (reversals, inconsistent names, test accounts, trials) and answer with a query and a sentence.

A business case question sounds like a stakeholder, not like a SQL exercise: “Where are our customers spending?”, “Which accounts should the dormancy team look at?”, “Why are customers leaving?”. There is no single right query until you have decided what exactly to measure. Interviewers grade that decision as much as the SQL.

Use four moves:

  1. Define the decision. What will someone do with the answer? (Target a campaign, contact dormant customers, fix a product gap.) This tells you the grain and the time window.
  2. Define the metric in one sentence, including what is excluded: “2025 card and online spending, excluding purchases that were later reversed, grouped by category.”
  3. Hunt the business traps in the data: rows that look like activity but are not (reversals, internal transfers, failed payments, test accounts, trials), names that are spelled several ways, flags that lag behaviour.
  4. Answer in a sentence with the number, then the caveat: “Home and bills dominates 2025 spending; rent and school fees drive it. Five percent of card spend has no category and is excluded.”

The first four exercises use Rawabi Bank (bank). Every transaction amount is positive and direction says whether money came in or went out; reversed purchases appear as a separate credit row pointing to the original; merchants arrive from the card network with inconsistent spelling; joint accounts have several holders in account_holders. The last two use Mizan Cloud (saas) subscriptions.

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