The First Time I Used SQL to Solve a Real Issue

There’s a big difference between learning SQL and actually using it to solve a messy, real-world business problem.
For me, that transformation happened when I was knee-deep in incentive data chaos for gig workers at Swiggy. Here’s the story. 👇


⚠️ The Real-World Problem:

Our gig worker incentive model relied on tracking completed orders during peak hours. But our system was over-reporting — payouts were exceeding forecasts.
Something wasn’t adding up.

After digging in, we found a critical issue:

Duplicate entries of the same order were inflating payouts and distorting performance metrics.


🧮 The Initial Manual Approach:

Before SQL, the usual method was to export data into Excel, apply filters, do VLOOKUPs, and try to manually find patterns.
But we were dealing with:

  • 10,000+ records daily
  • Multiple data columns (timestamps, user IDs, incentives, etc.)
  • Repeated reporting across zones

Manual detection was slow, error-prone, and mentally exhausting.


🧠 How SQL Became the Game-Changer:

I realized this was the perfect opportunity to apply my growing SQL knowledge.

Here’s how I solved it step by step:

🔢 Step💻 Action🧰 Tools Used
1Imported raw order data into SQL ServerSQL Server
2Identified fields causing duplication (order_id, timestamp, gig_worker_id)SQL
3Wrote a query using GROUP BY and HAVING COUNT(*) > 1 to isolate duplicatesSQL
4Applied ROW_NUMBER() logic to flag true duplicates based on timestamp prioritySQL
5Exported cleaned data for incentive processing in ExcelSQL + Excel
6Automated this weekly task using a reusable SQL scriptSQL

💬 Sample Query Snippet:

Then, I filtered only the first valid instance of each order using:


💥 The Outcome:

✅ Before SQL✅ After SQL
3+ hours/week spent on Excel checksAutomated checks in under 10 minutes
Frequent human errorsNear 100% accuracy
Disconnected insightsConnected order IDs with gig performance
Manual duplicate taggingDynamic identification using ROW_NUMBER()
Reactive reportingProactive issue spotting

The operations team was able to:

  • Save time ⏱️
  • Maintain payout integrity 💰
  • Resolve technical glitches causing duplicate logs ⚙️
  • Appreciate the true power of SQL 🎯

And me? I received my first ever direct shoutout on Slack for saving the day — and a boost of confidence in my BA journey! 🌟


🔍 Lessons That Stuck With Me:

  1. SQL isn’t just a querying language — it’s a business lifeline.
  2. You don’t need fancy dashboards to solve problems. Sometimes, a smart query does the job.
  3. Business Analysts aren’t just data readers — we’re data problem solvers.
  4. The cleaner the input data, the better the business outcome.
  5. Automation in analysis = long-term productivity.

📣 Final Thoughts:

That incident made me realize:

💬 “Learning SQL is great, but using SQL to bring real value? That’s when the magic happens.”
Today, it’s my go-to tool for anything data — from cleaning, filtering, transforming to delivering real insights.


🧭 What’s Coming Next?

Ready to go from querying data to visualizing performance?
Tomorrow, I’ll share how I use Power BI to track and present Gig Worker performance through interactive dashboards at Swiggy! 📊🚀


🏷️

#SQLJourney, #ProblemSolving, #BusinessAnalysis, #AnalyticsWithSakshamPulak, #EfficiencyMatters, #DataCleaning, #SQLforBusiness, #RealWorldSQL, #CareerGrowth, #SakshamPulak


Leave a comment

Hi, I’m Saksham Verma, a passionate Business Analyst at Swiggy with a deep interest in turning raw data into meaningful stories and strategies.

With hands-on experience in SQL, Python, Power BI, Tableau, Excel, and Snowflake.

AboutMe

Check Out My Other Web Pages

📊 Explore my analytics journey:
👉 Analytics with SakshamPulak

Turning data into direction.

My journey into analytics began with curiosity and evolved into a passion for solving real-world business problems.

From building dashboards at Swiggy to diving deep into data stories, I thrive at the intersection of insights, strategy, and impact. Whether it’s SQL queries or Power BI dashboards, I’m here to simplify complexity and make data work smarter.


🍲 Love food? Visit my blog:
👉 Cook With SakshamPulak

Bringing spice to every slice!

Outside of analytics, my creative spark comes alive in the kitchen. Cook With SakshamPulak is where I share recipes, kitchen hacks, and my love for bold flavors.

It’s a space for comfort food, weekend experiments, and stories that start with a pinch of spice and end with a smile.

Newsletter

Weekly Thoughts on Personal Development

We know that life’s challenges are unique and complex for everyone. Coaching is here to help you find yourself and realize your full potential.

About the Coach ›

Discover more from My Portfolio

Subscribe now to keep reading and get access to the full archive.

Continue reading