1. Difference between IN and IF EXISTS?
  2. What will be the Result of AVG() if any records have NULL values.
  3. Explain #Tables concept in detail with example? Have you implemented this in your project? If yes, then how?
  4. Variables in SQL? Types and USes?
  5. Difference between ROW_NUMBER(), RANK() and DENSE_RANK() with example
  6. One major difference between DELETE and TRUNCATE
  7. Major difference between WHERE and HAVING
  8. Explain below scenario about DELETE and TRUNCATE
A table has 5 records in it and the column is an identity column.
If we delete all records from the table and Insert record again. What will be the value in identity column?
If we truncate the table and Insert record again. What will be the value in identity column?

  1. Difference between CTE and Stored Procedures? Why we need SP and CTE?
  2. What is a Surrogate Key? What are the different Constraints available in SQL Server? Explain them with their use.
  3. Can we call Stored Procedure via “select *”?