Sign In | Feedback | Donate | Search
Katie and Emil Logo
Become a member*
No Ads Learner (Early Adopter)
for $1.99 per month Apply today!
* Members income helps develop more FREE content.

Welcome to our SQL Interview Questions and Answers page. This page contains 13 Questions related to SQL Querying (Select) only and starts with basic questions and finishes on advanced questions.

SQL Interview questions

If you would like to focus on basic SQL questions only then we recommend visiting our Basic SQL Interview Questions and answers

Top 13 "mixed" questions

Questions are split into 3 levels:

  • For Freshers (Beginner Level),
  • For Experienced (Intermediate Level - 2 to 3 years of experience) and
  • Advanced (4 and 5 plus years of experience)

Questions For Freshers:

1. What type of joins have you used? [answer]

2. How can you combine two tables/views together? For instance one table contains 100 rows and the other one contains 200 rows, have exactly the same fields and you want to show a query with all data (300 rows). This sql interview question can get complicated. [answer]

3. What is the difference between where and having clause? [answer]

4. How would apply date range filter? [answer]

5. What type of wildcards have you used? This is usually one of mandatory sql interview question. [answer]

6. How do you find orphans? [answer]

7. How would you solve the following sql queries using today's date? [answer]

First day of previous month, First day of current month, Last day of previous month, Last day of current month

Questions For Experienced:

8. You have a table that records website traffic. The table contains website name (multiple websites), page name, IP address and UTC date time. What would be the query to show all websites visited in the last 30 days with total number or visits, total number if unique page view and total number of unique visitors (using IP Address)? [answer]

9. How to display top 5 employees with the higest number of sales (total) and display position as a field. Note that if both of employees have the same total sales values they should receive the same position, in other words Top 5 employees might return more than 5 employees. [answer]

Advanced Questions:

10. How to get accurate age of an employee using SQL? [answer]

11. This is SQL Server interview question. You have three fields ID, Date and Total. Your table contains multiple rows for the same day which is valid data however for reporting purpose you need to show only one row per day. The row with the highest ID per day should be returned the rest should be hidden from users (not returned). [answer]

12. How to return truly random data from a table? Let say top 100 random rows? [answer]

13. How to create recursive query in SQL Server? [answer]

Did you find this page helpful?
Vote Yes! Yes! [+0]  |  Vote no! No? [-0]

Author: by Emil Glownia
Upsss... Something went wrong and Google Ads on our website did not display.

Google ads sponsor FREE content on our website and without them it would not exist.

How to fix the problem?
  1. Check if the Google Search display any ads by searching the term Business Intelligence
    • If ads don't display, try different search terms and if there no ads then there might be a problem with your browser. If you made changes to your browser behaviour then undoing them will help.
    • If ads display then, refresh our page one more time, if the problem is still there than please contact us.
  2. Become 'No Ads Learner' Member or if you are already one Sign In.
Take care
Katie & Emil
Well done! It seems Google Ads display properly now on our website.

Access our website's FREE content for FREE!