top of page

6 Questions to Ask Before Writing That SQL Query

  • Writer: Sarah Rajani
    Sarah Rajani
  • 8 hours ago
  • 6 min read

Asking the right questions upfront can save you hours in rework


Confused woman wondering how to start her SQL query
You’ve probably heard that SQL is one of the most important technical tools for any data analyst. But before you start writing any query, you need to ask some important questions.


Maybe you’ve experienced this…


You get a message pop up from someone asking you to pull some data for them. Okay, that’s fine, but why not save yourself some time upfront? You might even save yourself from doing extra work, if the data they need has already been reported on. Wouldn’t that be great?!


But what happens if you just jump right into the data and start querying?


After you’ve pulled the data and sent it off, your stakeholder might come back asking for even more data. Or maybe they want it for a different time frame. Or maybe they question the numbers and why they don’t match another report.


Now you just created more work for yourself. You have to rework your entire script and hope they don’t ask for anything else.


The real time-saver in data analytics work isn’t writing faster queries; it’s asking better questions before you write anything.


Before I write a single line of code, I pause and ask a set of questions. These questions aren’t complicated, but they’ve helped me avoid miscommunication, scope creep, and hours of (unnecessary) rework.


Here’s what they are, and why they are important to ask upfront:


1. What decision is this tied to?


This is always my first question, so that I have an idea of what they are ultimately looking for.




That one question tells me a lot:

  • If it’s for a leadership meeting, I’ll focus on clarity and high-level insights.

  • If it’s for internal brainstorming, I’ll get them insights faster, even if it’s not in a perfectly polished form.

  • If it’s part of a business case or report, I know to document sources and assumptions clearly.


The end use shapes the approach. Without knowing that, I’m just guessing what they need.


2. What do they mean by this [timeframe]?


Timeframes can be deceptively vague.


Someone asks, “Can you pull last month’s numbers?” and you nod, thinking it’s straightforward. But “last month” could mean any of the following:

  • The last calendar month (e.g., June 1 to June 30).

  • The last 30 days (e.g., June 9 to July 9).

  • The most recent fiscal month.

  • From the start of a campaign or promo.

  • Or even “the last full month” depending on when you’re asking.


These sound similar but will give completely different results.

So now I ask:

“When you say last month, do you mean calendar month or something else?”


More often than not, they’ll pause and go, “Oh… good point.” It’s surprising just how many different definitions for the same metrics are floating around in an organization.

3. Has this been requested before?


I like this one a lot, because many times there is already a report in existence that serves their needs… they might just not know about it.


But sometimes the request is brand new. More often than not, it’s a variation of something someone else already asked in the past.


That’s why I search through:

  • Past messaging threads.

  • My inbox.

  • Our shared folders or BI dashboards.


If I find a past version, I can:

  • Reuse or update the old query.

  • Check how we defined key metrics before.

  • Make sure numbers are consistent across reports.


This prevents one of the most frustrating things in analytics: delivering a number that looks different from what someone else produced, and having to spend hours explaining why.


4. Where do they think the data comes from?


Stakeholders often have a system in mind when they ask for data. I’ve had Compliance teams mention specific platforms they want the data from, so that narrows down my options, immensely.


Sometimes they’re right when they say, “It should be in Salesforce,” or “It’s probably in the CRM.”


Other times, the actual data lives in a product database, a billing system, or a custom warehouse table you built last year. It might even be on a manually updated Excel spreadsheet on someone’s laptop (yes, I’ve seen this first-hand).


And sometimes the data doesn’t exist at all. They assumed we tracked something, but we never did. (I’ve had this one happen to me a few times.)


So I ask:

  • “Where have you seen this before?”

  • “Which report or dashboard are you thinking of?”


And I ask them to share their report link with me (so that I don’t guess which version they are looking at).


If they’re comparing to something specific, I can match the source , or at least explain why it looks different. Many times, the mismatch is due to different filters or calculations, or even different timeframes.


5. What filters will (quietly) change everything?


Filters seem like a small detail, until they quietly make a mess of everything.


Let’s say I pull sales numbers filtered by:

  • Region = North America

  • Product type = A and B only

  • Status = Active customers


And then I send it over, and the stakeholder says, “Wait… this looks too low.”


In my mind, I know the numbers look low because I filtered it. But they don’t necessarily know that (or understand or why).


So now I ask clarifying questions upfront. It looks something like this:

  • “Do you want this filtered by customer status?”

  • “Should I include all products, or just a subset?”

  • “Is this global, or just your region?”


These questions might sound obvious, but they save me from building the wrong version of a perfectly correct query. Remember, stakeholders don’t necessarily understand the nuances of the data like you do, so you need to clarify (and clearly explain) what needs to be included and why.


6. Where is this going to live?


Where the report will end up shapes the output I will present the data in.


For example, if it’s going in:

  • A PowerPoint slide → I’ll clean the layout, round the numbers, and label everything clearly.

  • Excel → I’ll keep it copy/paste-friendly and flat.

  • Looker/Power BI/Tableau → I might suggest building a reusable view or dashboard.


So I always ask:

"Where’s this going to be used?”


That one answer helps me decide:

  • Do I output it as a table, chart, or raw export?

  • Do I need to use presentation-friendly field names?

  • Should I include notes or context?


Because how the data will be consumed by the end users lets me know how I need to present it. It can also shape how I do my analysis. Some simple validations might be more easily done in the BI tool at hand, or even in Excel.



Why I Track This (and Why It Works)


I started keeping a mental checklist of these questions because I was tired of chasing answers after the work was already completed.


Here’s what I’ve learned:

  • The moment you open your SQL editor, you start making assumptions. And every unasked question turns into a guess.

  • Those guesses might seem harmless, but sometimes, they lead to hours of rework, unnecessary follow-ups, or even worse , wrong numbers sent to the wrong people.


So now, these six questions are how I slow down before speeding up.


They help me:

  • Align expectations.

  • Avoid confusion.

  • Deliver results that actually get used.


And best of all, you’ve turned “Can you get this data for me?” from a vague ask into something you can confidently deliver, without second-guessing or backtracking at every step.



Asking the Right Questions is Critical to Success


I don’t use a request form or automated intake system (though those can be helpful too). I just ask these questions every time, via a conversation or email, and make sure to jot down the answers (in case I need to find out similar information in a future request).


If there’s any way you can do your work better and faster, why wouldn’t you? And the bonus is getting to avoid the “Oh… that’s not what I meant” moment we all know too well.


So the next time a request lands in your inbox, try pausing before you open that query console. You might be surprised how much time you save by just asking the right questions first.



Enjoyed this post?

I write about data, career transitions, and making analytics easier to understand.

Subscribe to my newsletter to get the latest posts.

If you want more content, I post regularly on LinkedIn, so connect and say hi!


Don't start your SQL query without asking some questions

Featured  posts

Never miss a post!

Picsart_23-12-11_19-22-35-636.jpg

I'm Sarah, a senior data analyst and writer. I run Data With Sarah, where I share practical tips, tools, and career advice for working in analytics.

Read more about me here:

The Data Analytics Stash

My Gumroad page is packed with data analytics resources, tools, and templates to help you save time and get better results.

Take a look! You’ll probably find something you’ll want to use right away.

images.png
bottom of page