Quick answer: How much SQL do I need for a data analyst job, and how is it tested?
- Baseline for every data role — SELECT, WHERE, ORDER BY, GROUP BY, HAVING, joins, NULLs.
- Usually added — window functions (ROW_NUMBER, LAG), CTEs and date logic.
- How it's tested — 45–90 minute online tests, live coding and take-home datasets.
- What fails candidates — NULL logic, row duplication from joins, WHERE vs HAVING.
- Why it pays — SQL appears in tens of thousands of Indian analyst job listings (AmbitionBox, Oct 2026).
Key takeaways
- SQL is screened before anything else in analyst, BI, product and data-engineering loops.
- Most rejections come from a handful of traps — NULLs, join fan-out and grouping mistakes — not from obscure syntax.
- Talking through edge cases while you write is scored as highly as the final query.
- AI can draft SQL, so employers increasingly test whether you can spot when a query is wrong.
- Two clean, commented portfolio queries on realistic data beat a list of courses.
Picture an online SQL assessment for a data analyst role at a Bengaluru e-commerce company: four questions, 60 minutes. The second asks for "customers who placed no orders in September". Half the candidates write an inner join and a WHERE clause — and return nothing, because the customers they want don't exist in the orders table. The ones who pass write a LEFT JOIN and check for NULL, or use NOT EXISTS. That one pattern quietly decides a large share of entry-level data hiring. This guide is about the patterns, traps and proof that get you through the SQL screen.

Why SQL is the skill employers test first
SQL — Structured Query Language — is how analysts, BI developers, product analysts and data engineers ask questions of data stored in relational databases and warehouses. It is old, standardised (the current ISO standard is SQL:20235) and everywhere, which is why it is the first technical filter in almost every data hiring process.
The demand shows in job listings. AmbitionBox's data analyst page, updated in October 2026, lists roughly 32,700 SQL-tagged jobs among its skill-based listings for data analysts — second only to Python and far ahead of Power BI and Tableau.1 Among professional developers in Stack Overflow's 2025 survey, SQL was one of the most-used languages, used by around six in ten respondents.2
- SQL-tagged data analyst jobs on AmbitionBox (Oct 2026)
- ~32,700
- Professional developers using SQL (Stack Overflow 2025)
- ~6 in 10
- Current ISO SQL standard
- SQL:2023
- Where SQL sits in most data hiring loops
- 1st
Which jobs need SQL, and how much?
Every data role uses SQL, but the depth expected varies.
| Role | SQL level expected | Typical SQL work |
|---|---|---|
| MIS / reporting analyst | Fundamentals | Extracts, filters, aggregates for recurring reports |
| Data analyst | Fundamentals + window functions | Ad hoc analysis, cohorts, dashboard datasets |
| Business analyst | Fundamentals | Checking volumes and edge cases behind requirements |
| Product / marketing analyst | Advanced | Funnels, retention, experiment analysis on events |
| BI developer | Advanced | Modelled datasets, performance |
| Data engineer / analytics engineer | Expert | Incremental models, merges, optimisation |
Table: SQL depth expected by role (editorial summary based on common job descriptions)
How employers test SQL
| Format | Length | What it checks | How to do well |
|---|---|---|---|
| Online assessment (HackerRank-style) | 45–90 minutes | Correctness on 3–6 problems | Read schemas carefully; test edge cases; manage time |
| Live coding | 30–60 minutes | Reasoning, communication, correctness | Clarify, talk through, write readable SQL |
| Take-home dataset | 2–6 hours | Business sense, clean queries, insight | Comment queries; lead with the answer |
| Whiteboard / verbal | 15–30 minutes | Concepts: joins, NULLs, grouping | Use small examples to explain |
Table: How SQL is tested in hiring (editorial summary)
What a fundamentals-level SQL test covers

Querying
SELECT, WHERE with AND/OR, IN, BETWEEN, LIKE, ORDER BY, LIMIT and DISTINCT.
NULL handling
IS NULL, COALESCE, and why = NULL never works. NULLs also change COUNT, AVG and comparisons.
Aggregating
COUNT, SUM, AVG, MIN, MAX with GROUP BY; HAVING to filter groups; COUNT(*) vs COUNT(column).
Joining
INNER, LEFT, RIGHT and FULL joins; anti-joins with LEFT JOIN … IS NULL or NOT EXISTS; self-joins.
Conditional logic
CASE WHEN for bucketing and pivot-style counts.
Modifying data
INSERT, UPDATE and DELETE with WHERE — and why you check with SELECT first.
PostgreSQL's free tutorial covers every one of these clearly,3 and its window-functions chapter is the natural next step.4
SQL interview questions, with how to answer them
"Find customers who placed no orders last month."
LEFT JOIN customers to orders filtered to last month in the ON clause, then keep rows where the order ID IS NULL — or use NOT EXISTS. Explain why putting the date filter in WHERE turns the LEFT JOIN into an inner join.
"Return the second-highest salary."
Use DENSE_RANK() in a subquery and filter rank = 2, or SELECT MAX(salary) WHERE salary < (SELECT MAX(salary)). Mention ties and the case where there is no second value.
"Find duplicate email addresses."
GROUP BY email HAVING COUNT(*) > 1. Add LOWER/TRIM if emails may differ in case or spaces.
"Top three products by revenue in each category."
Window function: ROW_NUMBER() or RANK() OVER (PARTITION BY category ORDER BY revenue DESC), then filter. Say which to use when there are ties.
"Month-over-month revenue growth."
Aggregate revenue by month in a CTE, then use LAG to get the previous month and compute the percentage change; handle the first month and missing months.
"What is the difference between WHERE and HAVING?"
WHERE filters rows before grouping; HAVING filters groups after aggregation.
"COUNT(*) vs COUNT(column)?"
COUNT(*) counts rows; COUNT(column) counts non-NULL values in that column.
"What happens if you join orders to order_items and sum order_total?"
Each order repeats once per item, so totals are inflated. Aggregate items first or sum at the right grain.
How SQL in hiring has changed
| Period | What happened | What employers tested |
|---|---|---|
| 2005–2012 | SQL mostly in IT and reporting roles | Basic queries, stored procedures |
| 2013–2018 | Analytics teams grow; online coding tests spread | Joins, aggregates under time pressure |
| 2019–2022 | Cloud warehouses make SQL the analyst's main tool | Window functions, CTEs, analytical patterns |
| 2023–2024 | Leaner teams expect self-sufficient analysts | Business-question SQL on realistic schemas |
| 2025–2027 | AI assistants draft queries | Verifying generated SQL, edge cases, explaining logic |
Table: How SQL testing in hiring has changed (editorial summary)
Prove it: SQL evidence that persuades

- A verified test score — a timed SQL test with a credential employers can check.
- Two portfolio queries — on realistic public data, each answering a business question.
- Readable style — CTEs, aliases, consistent formatting and comments.
- Edge cases noted — NULLs, duplicates and time zones called out in comments.
- A short write-up — the question, the answer and one chart.
Résumé and LinkedIn wording
List SQL with context, not just the word: "SQL (PostgreSQL, BigQuery) — window functions, CTEs, cohort and funnel analysis." In bullets, connect SQL to outcomes: "Wrote the SQL behind a weekly retention report used by the growth team; found a 9% drop in week-2 retention traced to a broken onboarding email."
Could you pass the SQL Fundamentals Certification today?
Hiring managers test judgement with scenarios like this one. Answer it before you open the explanation — the test has 10 of them, 10 minutes, 70% to pass.
Which keyword limits a query to 10 rows in PostgreSQL and MySQL?
- LIMIT 10
- TOP 10 only
- FIRST 10
- MAX 10
Show the answer
A. LIMIT 10 — LIMIT restricts row count (SQL Server uses TOP).
- 01Querying
- 02Aggregating and joining
Free, no sign-up. Pass and you become a SQL Fundamentals, with a credential ID employers can verify. Every answer is explained either way.
What SQL adds to your pay
SQL on its own doesn't set a salary, but it opens the roles that pay more. On AmbitionBox in October 2026, data analysts typically earned ₹6.5–7.2 lakh and business analysts ₹9.6–10.7 lakh,16 while MIS roles with lighter SQL sit lower. The pattern across Indian data careers: the deeper your SQL and the closer it sits to business decisions, the higher the pay band.
| Role (India) | Typical pay | SQL depth |
|---|---|---|
| Data analyst | ₹6.5–7.2 lakh | Fundamentals + windows |
| Business analyst | ₹9.6–10.7 lakh | Fundamentals |
| Data engineer | ₹11.5–12.7 lakh | Expert |

Table: Typical pay for SQL-heavy roles in India (AmbitionBox, Oct 2026; indicative)
AI and SQL skills
AI assistants now write first-draft SQL from plain English. Employers have responded by testing understanding: interviewers increasingly show a generated query and ask what's wrong with it. The skills that matter are knowing the data's grain, spotting fan-out and NULL errors and checking results against a sanity number. The World Economic Forum lists analytical thinking as employers' most-wanted core skill,7 and with SQL that means not trusting a query you can't explain.
A six-week SQL plan for job seekers

- Week 1: Querying — SELECT, filters, sorting, NULLs. Twenty problems.
- Week 2: Aggregating — GROUP BY, HAVING, CASE. Twenty problems.
- Week 3: Joining — All join types, anti-joins, self-joins, fan-out traps.
- Week 4: Prove the basics — Take the SQL Fundamentals Certification and review every explained answer.
- Week 5: Windows and CTEs — ROW_NUMBER, RANK, LAG, running totals.
- Week 6: Interview practice — Timed sets of four problems; two portfolio queries written up.
When the basics are solid, the Advanced SQL assessment and our advanced SQL guide cover the harder rounds. For analyst roles, pair SQL with the Excel skills guide and Python for data analysis.
Worked example: the anti-join, done right
The question: "Which customers placed no orders in September 2026?" Here is the version that passes, with the reasoning interviewers want to hear.
SELECT c.customer_id, c.name
FROM customers AS c
LEFT JOIN orders AS o
ON o.customer_id = c.customer_id
AND o.order_date >= DATE '2026-09-01'
AND o.order_date < DATE '2026-10-01'
WHERE o.order_id IS NULL;
Three things make it correct. The date filter sits in the ON clause, so customers without September orders still appear with NULLs; moving it to WHERE would quietly turn this into an inner join and return nothing. The date range uses "greater than or equal to the first, less than the next month's first", which works whether order_date is a date or a timestamp. And the check is on o.order_id, a column that can only be NULL when there's no match. Say all three out loud and you've shown more than most candidates.
Practice tasks that build SQL skill
Reading about SQL doesn't build the skill; answering questions on realistic tables does. These five tasks mirror what entry-level tests ask.
- Load a real dataset — Download a public dataset (India's Open Government Data platform, data.gov.in, has hundreds) into PostgreSQL or SQLite and write ten questions you'd ask of it.
- Customers with no orders — Build a tiny customers and orders schema and write the anti-join three ways: LEFT JOIN with IS NULL, NOT EXISTS and NOT IN. Find the case where NOT IN breaks with NULLs.
- The fan-out trap — Join orders to order items, sum order totals and watch them inflate; then fix it by aggregating at the right grain.
- Monthly summary — Revenue, orders and average order value by month with GROUP BY, then filter months with HAVING.
- Timed set — Four problems in 45 minutes, written out loud as if explaining to an interviewer.
Where SQL takes your career
SQL is the common thread through most data careers in India. These AmbitionBox ranges (typical pay, October 2026) show where it leads as the depth grows.
| Role | Typical pay (India) | How SQL is used |
|---|---|---|
| MIS analyst | ₹4.2–4.7 lakh | Extracts and recurring reports |
| Data analyst | ₹6.5–7.2 lakh | Daily analysis and dashboard datasets |
| Business analyst | ₹9.6–10.7 lakh | Checking requirements against data |
| BI analyst | ₹9.5–10.4 lakh | Modelled datasets and KPIs |
| Product analyst | ₹11.5–12.8 lakh | Funnels, retention and experiments |
| Data engineer | ₹11.5–12.7 lakh | Pipelines and incremental models |

Table: Roles built on SQL and their typical pay in India (AmbitionBox, October 2026; indicative)
Mistakes that cost candidates the SQL round
- Not reading the schema — guessing column meanings.
- Silent wrong answers from NULLs and join fan-out.
- No clarifying questions about duplicates, time zones or "last month".
- Unreadable one-line queries.
- Never testing with a quick count or a known example.
How we know
Job-listing and pay figures come from AmbitionBox's data analyst and business analyst pages (read October 2026). Usage figures come from Stack Overflow's 2025 Developer Survey. SQL references are the PostgreSQL documentation and ISO's SQL standard listing. Market context comes from the World Economic Forum. Test formats and the history table are editorial summaries. Science of Apps publishes the free certification linked here. Last reviewed October 2026.
Key terms, defined
- Query — a request for data written in SQL.
- JOIN — combining rows from two tables based on a related column.
- Anti-join — finding rows in one table with no match in another.
- Aggregate — a function that summarises many rows, such as SUM or COUNT.
- NULL — a missing or unknown value, which behaves differently from zero or an empty string.
- CTE — common table expression: a named subquery defined with WITH.
- Window function — a calculation across related rows that keeps each row, such as a running total.
Frequently asked questions
How much SQL do I need for a data analyst job?
For an entry-level role, confident use of SELECT, filtering, sorting, aggregates with GROUP BY and HAVING, inner and left joins, CASE, NULL handling and basic subqueries. Most employers also expect or prefer window functions such as ROW_NUMBER and LAG, CTEs and date functions. Senior roles add performance and data modelling.
How is SQL tested in job interviews?
Usually through a timed online assessment with three to six problems, a live coding round where you write and explain queries, or a take-home dataset with business questions. Interviewers check correctness, readability and whether you think about edge cases such as NULLs, duplicates and time zones.
Can I learn SQL in a month for a job?
You can learn the fundamentals in three to four weeks of daily practice, enough to pass many entry-level screens. Getting comfortable with window functions, tricky joins and interview pressure usually takes another month of practice on realistic problems.
Which SQL dialect should I learn?
Any major one: PostgreSQL, MySQL, SQL Server or BigQuery. Core SQL is shared across them; date functions and a few features differ. PostgreSQL is a good default because it closely follows the standard and has excellent free documentation.
What are the most common SQL interview questions?
Second-highest salary, duplicate rows, customers with no orders (left join with NULL check), top N per group, running totals, month-over-month growth, retention or repeat purchase rates, and the difference between WHERE and HAVING or between join types.
Is SQL enough to get a data analyst job?
SQL is necessary but rarely enough on its own. Most analyst roles also expect Excel, a BI tool such as Power BI or Tableau, basic statistics and clear communication. SQL is the skill that gets you past the first technical screen.
Sources
- AmbitionBox — Data Analyst salaries and skill-based jobs in India (updated 26 Oct 2026)
- Stack Overflow — 2025 Developer Survey, Technology
- PostgreSQL Documentation — The SQL Language (tutorial)
- PostgreSQL Documentation — Window Functions (tutorial)
- ISO — ISO/IEC 9075-2:2023, Information technology — Database languages SQL — Part 2: Foundation
- AmbitionBox — Business Analyst salaries in India (updated 24 Oct 2026)
- World Economic Forum — The Future of Jobs Report 2025
- Checked October 28, 2026. Figures that change — fees, salaries, prices — are reviewed every six months; if something is out of date, tell us.
Certifications to take next
- 14 AI skills for data analysts — copy-paste prompts for this job, one tap into ChatGPT or Claude
- SQL Fundamentals Certification — the free 10-minute test on querying, aggregating and joining
- Advanced SQL interview guide — window functions, CTEs and performance, for the harder rounds
- SQL vs NoSQL — how relational databases compare with the alternatives
- Free skill test · 10 minMicrosoft Excel Fundamentals CertificationTests core Excel skills — cell references, essential formulas, sorting and filtering, tables, basic charts, conditional formatting and PivotTables.
- Free skill test · 20 minAdvanced SQL AssessmentTests advanced SQL — window functions, CTEs, subqueries, complex joins, deduplication, date logic, query performance and indexing.
- Free skill test · 15 minBusiness Analyst CertificationTests core business analysis — stakeholder analysis, requirements elicitation and documentation, process modelling, data analysis, solution evaluation and BABOK-aligned practice.
- Free skill test · 15 minTableau Data Visualization CertificationTests Tableau — dimensions and measures, discrete vs continuous fields, calculated fields, LOD expressions, filters and their order, dashboards and performance.
- Free skill test · 15 minPython for Data Analysis CertificationTests data analysis in Python — pandas DataFrames, filtering, groupby, merging, handling missing data, time series, visualisation and reproducible notebooks.
- Free skill test · 15 minMachine Learning Fundamentals CertificationTests ML basics — supervised vs unsupervised learning, features and labels, train/validation/test splits, overfitting, common algorithms and when ML is the right tool.
Career guides for related roles
- Career guidesPython for data analyst jobs in 2027: the pandas skills employers test, the take-home that decides it and what to skipPython for data analyst jobs in 2027: the pandas and cleaning skills employers test, typical take-homes, interview questions with answers and a plan.
- Career guidesHow to get a product analyst job in 2027: the metrics, SQL and experiment skills that get you hiredHow to get a product analyst job in 2027: what hiring managers test (SQL, metrics, experiments), the interview loop, India and global pay, and a 12-week plan.
- Career guidesHow to get a data engineer job in 2027: pipelines, modelling and the system-design round that decides itHow to get a data engineer job in 2027: the SQL, Python and pipeline-design skills employers test, the interview loop, India and global pay, and a 12-week plan.
- Career guidesData cleaning skills for data jobs in 2027: what employers test, the traps in take-homes and how to show you're carefulData cleaning skills for data jobs in 2027: missing values, duplicates, formats and outliers, how take-homes test them, questions with answers.
- Career guidesHow to get a Tableau developer job in 2027: LODs, filter order and a Tableau Public portfolio that gets callbacksHow to get a Tableau developer job in 2027: the skills employers test (LODs, filters, performance), a Tableau Public portfolio, pay in India and a 12-week plan.
- Career guidesHow to get a Power BI developer job in 2027: data models, DAX and the report that wins the interviewHow to get a Power BI developer job in 2027: the data modelling and DAX skills employers test, PL-300, the interview loop, India pay and a 12-week plan.
Get the ideas, not the noise.
Sign up with Google and we’ll send you short UX psychology tips by email — why people tap, stall and leave, and what to do about it. Unsubscribe anytime. Prefer something to keep? Get the free Laws of UX guide as a PDF.
You've read the playbook. Now prove it.
Take the free SQL Fundamentals Certification and earn SQL Fundamentals (SOA-SQL). Free, test-based certifications graded on our server. Pass and you get a founder-signed certificate with a credential ID and QR code employers can verify.






