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 SQL Server language.

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

Basic Connections and Configurations

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

SQL Interview Questions on Date and Time

  1. Format DATE
  2. Return Date Part Only from a DateTime datatype

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. Data
  2. Calculating Running Total
  3. Convert Rows into Columns without applying PIVOT
  4. Convert Column Names into Rows without using UNPIVOT
  5. Export Data to CSV
  6. Nth Highest Salary
  7. Automatically Backup Database
Categories SQL