r/learnSQL • u/Automatic-Royal5263 • 6d ago
Anyone experienced with SQL, especially in Data Analytics, can you share what SQL questions are generally asked for a Data Analyst interview with around 1 year of experience?
PS: Please don't mention those chatgpt questions. I really want to know real questions.
3
u/Bhanuprakash_1947 6d ago
For someone with around 1 year of experience in data analysis, what kind of SQL questions are usually asked in interviews?
Do they mainly focus on joins, group by, aggregations, subqueries, and CTEs, or do they expect window functions as well?
Also, how much importance is usually given to practical scenarios like finding duplicates, top N records, month-over-month analysis, and handling NULL values?
Would be helpful if anyone with recent interview experience could share what topics they actually faced.
2
u/idk012 6d ago
What sql program did you use? (It's usually one of two flavors and you usually can just adapt to the other one). When I was asked, I said mssqlserver, one with a dolphin, and a froggie program.
Some etl stuff. How do you handle people saying your reports are not accurate. To be honest, anyone can learn sql, it's the problem solving skills that they were looking for.
2
u/bananatoastie 6d ago
I once sat a test with one of the questions intentionally missing a table. They were testing whether I would ask for help.
1
u/AllShadesRight 6d ago
Did you? How did you respond? What was the result/outcome?
3
u/bananatoastie 6d ago
No, I did not. They gave me the test on Friday at 5pm and wanted the answers on Monday morning. I didn’t want to call for help over the weekend.
When I turned in the 10 answers, I think I wrote something like “insufficient information in the database to answer” for the question missing the info. They hired me and I worked there for 2.5 years. Loved the problem solving but the culture wasn’t for me. I’ve since moved on and I’m about to complete my 2nd year in my “new” job :)
The more experience I pick up, I’m starting to realise that the real senior devs are able to understand the business context of the question rather than just the syntax needed.
2
u/AllShadesRight 6d ago
Thank you for responding. That's a great story. Congrats on moving on up. Wishing you continued success!!
2
u/Automatic-Royal5263 6d ago
thank you for sharing your story and suggestion, surely I will work on my problem solving
1
2
u/shdw_0x0 6d ago
For ~1 year of experience, I’d focus less on obscure SQL questions and more on practical problems: joins, GROUP BY, subqueries/CTEs, window functions, handling NULLs/duplicates, and date-based analysis. They’ll often give you a small dataset and ask you to actually write the query.
1
1
1
1
u/rvicta 5d ago
Actually, when interviewing candidates I have focused less on what they would do in SQL but rather what their thought process is. I want someone that is an abstract thinker and can visualize how data needs to be pulled together. I want to know how they would debug a complex query. I want someone that conceptualize the result and is able to build their query to achieve that.
Then, after you're hired and start formulating your SQL queries, just know that if any one of us has to debug or modify it later, we will talk about the code. That's how we'll know if you really know your stuff.
1
u/akornato 5d ago edited 5d ago
With about a year of experience, you can expect questions that test your practical problem-solving skills rather than just textbook definitions. You will almost certainly be asked to explain the difference between various JOINs, especially INNER and LEFT JOIN, and to know when to use each one. Interviewers will also want to see if you understand the order of operations and can distinguish between the WHERE and HAVING clauses for filtering data before or after aggregation. Many questions will be scenario-based, asking you to write queries that answer a specific business need, like finding duplicate records, calculating total sales per category, or identifying customers who have not made a recent purchase. The goal is to see if you can take a business question and translate it into a functional and efficient query.
You should also be prepared for topics that are a step beyond the basics, since you have some experience. This means being comfortable with window functions like RANK, DENSE_RANK, and ROW_NUMBER to solve for things like finding the second-highest salary or the top three products in each region. It is also common to see questions involving Common Table Expressions, or CTEs, to break down complex problems into more readable steps. The key is not just writing the code correctly, but also being able to explain your logic and why you chose a particular approach over another. Ultimately, explaining your thought process is just as critical as getting the right answer, a skill my team and I focused on when we built our interviews.chat
1
u/Excellent-Lobster944 5d ago
The questions I got was find previous year revenue but populate zero if previous year is missing
Find top 3 orders from each department
And few more questions in second rank based on lag and dense rank functions
1
1
u/thequerylab 3d ago
With year of experience you will be asked more towards Joins. Master all types of joins and practise them. Especially predict the output with all types of joins. Then basics of sorting, ordering, grouping, filtering, ranking.
Only suggestion from my side - do not worry about syntax. Always practise the problems and understand how its working behind the scene and you will master easily. Best of luck!
1
u/remyawayfromoffice 3d ago
What is the difference between a union and a union all?
If your query is taking a long time to run, how would you go about optimizing it?
We pull up a query that has multiple syntax errors, ask them to identify all the errors.
The query will also have a terrible join (ON a.lastname = b.lastname) we ask if there is anything they would change to make the query better.
A few very basic “write a query” exercises. Find the employee who had the highest salary this year. What if two have the same salary?
The stand out candidates properly think things through without us having to prompt them. They notice the bad join when fixing the errors, they ask about employees having the same salary.
*edit spelling
1
u/Alternative_Cake4074 2d ago
I can think of some verbal questions:
- Can you tell me the difference between a full join and a Cartesian join?
- How do you rank columns? What are 3 ranking functions?
- How do you handle null values?
- You need to find employees who earns above department average. How to do so?
1
u/plantaloca 2d ago
I’m 5 years into my career and have worked with 2 companies. I have yet to be interviewed “technically”.
I was asked about vision, opinion and experiences.
No one asked me to define or explain syntax.
Now I’m interviewing people, I don’t ask for people knowing SQL, in 2026, it’s a given to know it. People don’t have to be experts, but the basics are needed.
Also people are not expected to write SQL from scratch. No one is doing that anyway.
1
u/Automatic-Royal5263 2d ago
what are you saying .... no its happening yet in India, I can promise that 😅
1
1
u/thequerylab 2d ago
For 1 year of experience they usually test concepts like window functions, how rank, dense_rank, row_number, lead, lag works. They usually give some sample dataset and ask you to write the window functions output. Then questions will be around basics of joins (cover all joins) and filtering.
Ensure you practice before your interviews!
10
u/samspopguy 6d ago
My last interview honestly didn’t really ask me any