SQL Interview Questions

This SQL Server article covers some faqs, interview questions, and advanced topics. The following is a list of frequently asked interview questions in this language.

  1. Attach Database
  2. Detach Database
  3. Get Database Names
  4. Add column
  5. Rename Table
  6. Get Table Names from the Database
  7. Get Column Names from Table
  8. Swap Column Values
  9. Check if a Table Exists
  10. Identity Value Jumps after restarting
  11. Find all Dependencies on Table
  12. Find all tables that Contain Specific Column Name
  13. Rename Table Name and Column Name

Basic Connections and Configurations

  1. Connect to SQL Server using sqlcmd utility
  2. Uninstall SQL Management Studio
  3. Create ODBC Connection
  4. Create ODBC Using Native Client 11.0
  5. Connecting to R programming
  6. Configure Database Mail
  7. Login Errors

SQL Interview Questions on Date and Time

  1. Format DATE
  2. Return Date Part Only from a DateTime datatype
  3. Standard Date and Time Strings

Differences

  1. Difference between DATEPART and DATENAME
  2. Difference between UNION and UNION ALL
  3. Differentiate between CTE, Temp, Derived, Tbl Variables

Joins

  1. Cross Join Vs. Inner Join
  2. List of Outer Joins

SQL Interview Questions on Groups

  1. Count Records in a Group
  2. Retrieve the Last Record in each Group
  3. Select Top N Records for each Category
  4. Select the First Row in each group

Select, Insert, Update, and Delete

  1. Delete Duplicate Rows
  2. Insert values into the Identity Column using IDENTITY INSERT
  3. Insert Stored Procedure result into Temporary tbl
  4. How to Insert Images
  5. Select Rows with Maximum Value on a Column
  6. Select All If the Parameter is Empty or NULL
  7. UPDATE Columns from SELECT

SQL Interview Questions on Strings

  1. Concatenate Rows into String
  2. Replace String in a Column
  3. Reverse String Words
  4. Select Domain From Email

Misc queries

  1. Calculating Running Total
  2. Convert Rows into Columns without applying PIVOT
  3. Convert Column Names into Rows without using UNPIVOT
  4. Export Data to CSV
  5. Nth Highest Salary
  6. Automatically Backup Database
Categories SQL