|
Hey Reader, Quick question: Could a colleague open your most recent SQL query and understand what it does without asking you a single question? If the answer is "probably not," this newsletter is for you. Writing SQL that works is step one. Writing SQL that someone else can read, trust, and maintain — that's the skill that changes how people see your work. Why This Matters More Than You ThinkHere's what I've noticed over 15+ years in analytics: the analysts who get promoted aren't always the ones who write the most complex queries. They're the ones whose work is so clear that other people can build on it. When your analysis is easy to follow:
When it's not: every analysis becomes a bottleneck that requires you to explain it. That limits your impact. Three Documentation Habits That Make a DifferenceHabit 1: Comment the "Why," Not the "What"
The "what" is visible in the code itself. The "why" disappears unless you write it down. Six months later, you'll need the why more than the what. Habit 2: Use CTEs to Tell a StoryCompare these two versions of the same analysis: Version A: One big query
Version B: CTEs with clear steps
Same results. Version B is readable by anyone on your team. Each CTE has a name that describes what it calculates. The comments label each step. A new analyst joining your team can follow the logic without asking you what it does. Habit 3: Name Things for Business UsersColumn names your manager won't understand:
Column names anyone can read:
This takes 10 extra seconds when writing the query and saves 10 minutes every time someone reads it. Including you. A Template for Documented AnalysisHere's a pattern to use for any analysis that might be shared or revisited:
It takes 2 minutes to add this header. That 2-minute investment saves hours of "wait, what does this query do?" conversations. The Speed of TrustA documented query isn't just easier to read. It's easier to trust. When leadership reviews your analysis, clean documentation signals: "This person is thorough. I can rely on their numbers." Messy, uncommented queries signal the opposite — even if the results are correct. This isn't about perfection. It's about building a reputation for clear, reliable work. Over time, that reputation compounds into bigger projects, more visibility, and greater career impact. Start TodayPick your most recent SQL query and apply these three habits:
It won't take long. And the next time someone opens your work, they'll notice the difference. Until next time, Brian P.S. Clear, well-structured queries are a running theme throughout SQL for Business Impact. Every module teaches not just the SQL pattern, but how to structure and present it clearly. It's the difference between writing queries and doing analysis. Check it out at sqlforbusinessimpact.com. P.P.S. What does your team's SQL documentation look like? Are queries well-documented or is everything tribal knowledge? Hit reply — I'm curious how different teams handle this. I read every response. |
Learn to build analytics projects with SQL, Tableau, Excel, and Python. For data analysts looking to level up their career and complete beginners looking to get started. No fluff. No theory. Just step-by-step tutorials anyone can follow.
Hey Reader, Last month, we covered LEFT JOIN to find customers who never booked. That's one type of absence — people who never showed up. But there's another kind that's even more expensive: people who showed up, committed, and then left. The dreaded cancellation. Customers who said "yes", then said "actually, never mind". In the Summit Adventures database (the fake adventure tourism company I created to help people learn business analytics), nearly 47% of all bookings end in cancellation....
Hello Reader, This week's newsletter is a bit different. There's SQL in here, but the real topic is career strategy. Because one of the most common questions I get from readers is some version of: "I've been learning SQL for a few months. How do I prove I can actually do this job?" The honest answer: a portfolio of 2-3 projects that demonstrate business thinking, not just technical syntax. The problem is most portfolios I've reviewed look the same. A Kaggle competition. A tutorial from...
Hello Reader, A common analytics question that sounds simple but isn't: "Which customers have booked the same type of expedition more than once?" You can't answer this with a regular JOIN between two different tables. The information lives in one table. You need to compare rows within that table to find patterns. That's what a self-JOIN does. It joins a table to itself. It sounds unusual, but once you see the pattern, you'll recognize situations where it's exactly what you need. The Business...