Home » SQL Interview Q & A

SQL Interview Q & A

A Series of SQL Server basics to advanced level SQL Interview questions and answers that are commonly asked in interview.




SQL Server QUIZ

  1. SQL Quiz on Substring function
  2. SQL QUIZ on Select Statement
  3. SQL Quiz on Create Statement

[ Also Read: SQL Server Basics Tutorial]

SQL Server Interview Questions and Answers

  1. How to get the definitions of stored procedures, user defined functions and triggers in SQL ?
  2. What is SQL Server user defined table type and table valued parameters?
  3. How to access the files name list from window directory folder to SQL Server table using T-SQL query?
  4. Difference between Truncate and Delete statements in SQL Server?
  5. How to access a data of table from another database in SQL Server?
  6. How to check if user table or temp table exists or not in SQL Server database?
  7. How to display a cumulative Total/ Running Total in SQL?
  8. What is correlated subquery in SQL?
  9. Difference between NULL and BLANK in SQL Server?
  10. How to implement a custom sorting in SQL Server?
  11. Difference between Primary Key and Composite Key?
  12. What is Sequence in SQL?
  13. What is foreign key in SQL server and how to add a foreign key in existing table?
  14. What is SQL drop table command, does it support rollback ?
  15. What is unique key constraint in SQL Server ?
  16. What is TRY..CATCH block and how to handle T- SQL code error using TRY.. CATCH block?
  17. How to Pivot a table in SQL Server?
  18. What is triggers in SQL ?
  19. What is Merge Statement in SQL and use of Merge in SQL ?
  20. How to create Jobs in SQL Server ?
  21. What is Views in SQL Server?
  22. What is SQL Server temporary tables?
  23. What is GROUPING SETS in SQL?
  24. What is CUBE in SQL ?
  25. What is IIF() Logical Function is SQL ?
  26. What is Choose() logical function in SQL?
  27. How to identify blocking processes/long running queries in SQL server ?
  28. What is SQL Server Computed Columns ?
  29. How to find out identity column without using column name ?
  30. How to configure SQL Server Database Mail ?
  31. How to troubleshoot SQL Server Database Mail?
  32. What is synonyms in SQL Server and its role ?
  33. How to insert explicit values into identity column ?
  34. How to send a SQL Server Query result in text format using database e-mail?
  35. What is NEWSEQUENTIALID() function in SQL Server, what is the difference between NEWSEQUENTIALID() and NEWID() ?
  36. How to get the sizes of all databases on a SQL Server ?
  37. How to display currency symbol for different different cultures in SQL Server?
  38. How to concatenate rows of strings into one string with a specified separator?
  39. How to find Nth highest salary in SQL Server ?
  40. How to display detailed truncation error in SQL Server ?
  41. How to Split Comma Separated string values into columns? 
  42. How to Display calendar dates for any n numbers of years in SQL Server?
  43. SQL Server VARCHAR VS NVARCHAR
  44. SQL Server CHAR VS NCHAR?
  45. What is the difference between SQL Server Stored Procedures and User Defined Functions (UDF)?
  46. FOR JSON clause in SQL Server?
  47. What is LogOn trigger in SQL Server?
  48. How to get all the tables in database those contains primary key constraints ?
  49. How to create a dynamic column in pivot ?
  50. How to unpivot the table data in SQL Server?
  51. Write SQL query to get the students who have scored higher than 80 marks and sort result based on last three characters of name and StudID in ascending order ?
  52. Print prime number separated by comma till n numbers in SQL?
  53. What is cascading referential integrity in SQL Server?
  54. SQL CROSS APPLY vs OUTER APPLY, and how do they differ from Joins?
  55. How to get the last accessed time for tables in SQL Server?
  56. How to copy or delete files from directory in SQL Server?
  57. How to change the column collation to case sensitive?
  58. How to auto execute any stored procedure on SQL Server Services startup ?
  59. How to encrypt a stored procedure in SQL Server?
  60. How to Read SQL Server error logs?
  61. How to extract a Scalar value from JSON string?
  62. How to extract a Json object and Json array from JSON string?
  63. How to modify property and it’s value in JSON string?
  64. How to separate numbers, letters and special characters from string?
  65. What is SQL Ident_current function and how it differ from @@Identity and Scope_Identity?
  66. How to select top n records for each category from table?
  67. How to change the column name and their data type of result set of stored procedure?
  68. What is Table Value Constructor?
  69. How to generate a scripts for database with schema and data?
  70. How to script a table in SQL Server?
  71. How to check if column exists or not in SQL Server table?
  72. How to get row count for all tables in SQL Server ?
  73. Date and Time Conversions in SQL Server using Convert function.
  74. How to store the output of stored procedure into a table/temp table?
  75. How to insert a multi language/multilingual data in table?
  76. How to Update records from select statement in SQL?
  77. Difference between Clustered and Non-Clustered indexes in SQL Server ?
  78. How to fetch an alphanumeric from string?
  79. How to generate a range of numbers between two numbers in SQL Server?
  80. How to search for string within xml column in SQL table?
  81. How to find leading and trailing spaces in SQL Server ?
  82. How to compare column names in two tables in SQL Server ?

[Also Read.. SSRS Tutorial,  SQL Server Advance Tutorial,  Power BI Tutorial ]




SQL Server Basics Tutorial

SSRS Tutorial

SQL Server Advance Tutorial

Power BI Tutorial

 8,132 total views,  1 views today