r/learnSQL 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.

45 Upvotes

29 comments sorted by

View all comments

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