Basic SQL Interview Questions




This blog post has been created to cover basic SQL interview questions and answers and we will use questions related to SQL Server however most of them might be applicable to other database products.

The best results achieve people who study and practice their skills and I would recommend to avoid simple memorization of answers.

Basic SQL Interview Questions

Questions with * are related to SQL Server or when I am not sure if the same behavior is in different products.

First part is theory SQL questions.

Questions:

  1. What does SQL Stands for?
  2. Name all SQL Clauses in correct order and briefly describe them.
  3. What is the difference between WHERE and HAVING?
  4. How would you join multiple tables together in a query?
  5. Name all joins types you know and describe them.
  6. What is a subquery and a derived table?
  7. What is an aggregate function?
  8. Describe all types of aggregate functions you know. 
  9. What is the difference between deterministic and non-deterministic functions?
  10. Describe Logical Query Processing.

Answers:

1. What does SQL Stands for?

  • SQL stands for Structured Query Language. For more info visit What is SQL?

2. Name all SQL Clauses in correct order and briefly describe them.

3. What is the difference between WHERE and HAVING?

  • Where filters rows. Having filters groups.

4. How can you combine two queries together which contain the same structure but cover different time period.

5. Name all joins types you know and describe them.

6. What is a subquery and a derived table?

  • Subquery allows us to get single field values (or values) inside our main query (for instance where condition or select)
Are you a paid member?

Log in or Buy Membership
Unlimited use access passes from $9
and long term discounts up to 87%





Did you find this page useful? +11  |  -0
(11 Votes)

Info is straight forward
Top basic questions are present