Ravindra BagaleCourses & study guides Track your progress

1. What Is SQL and Why Analysts Need It

1.5 How Analysts Use SQL at Work (Retail, Bank, Clinic Stories)

Why. SQL feels abstract until you hear work stories.

What. Analysts use SQL to filter sales, join customers, and build clean tables for Excel or Power BI.

How. Retail: coffee orders by city. Bank: transactions above a limit. Clinic: appointments this week. Same SQL patterns.

Steps

  1. Retail story: Pune sales this month → WHERE city + date.
  2. Bank story: Transfers over 500 USD → WHERE amount.
  3. Clinic story: Open tickets → WHERE status.

Examples

Example 1 · dataset: raja_coffee

SELECT city, COUNT(*) AS orders
FROM orders
GROUP BY city
ORDER BY orders DESC;

Output

cityorders
Pune10
Nashik3
Mumbai3
Kolhapur3
Goa3
Solapur2

Meaning. Retail story in one query: how many orders per city.

Ravindra Bagale's Tip

Write the business question in one sentence before you write SQL.