T-SQL Interview Questions


1. What is RDBMS?
2. What are the Properties of the Relational Tables?
3. What is Normalization?
4. What is De-normalization?
5. How is ACID property related to Database?
6. What are the Different Normalization Forms?

7. What is a Stored Procedure?
8. What is a Trigger?
9. What are the Different Types of Triggers?
10. What is a View?
11. What is an Index?
12. What is a Linked Server?
13. What is a Cursor?
14. What is Collation?

15. What is the Difference between a Function and a Stored Procedure?
16. What is subquery? Explain the Properties of a Subquery?
17. What are Different Types of Join?
18. What are Primary Keys and Foreign Keys?
19. What is User-defined Functions? What are the types of User-defined Functions that can be created?

20. What is an Identity?
21. What is DataWarehousing?
22. What languages BI uses to achieve the goal?
23. What is Standby Servers? Explain Types of Standby Servers.
23. What is Dirty Read?
24. Why can’t I use Outer Join in an Indexed View?
25. What is the Correct Order of the Logical Query Processing Phases?

26. Which TCP/IP port does the SQL Server run on? How can it be Changed?
27. What are the Difference between Clustered and a Non-clustered Index?
28. What are the Different Index Configurations a Table can have?
29. What are Different Types of Collation Sensitivity?
30. What is OLTP (Online Transaction Processing)?
31. What’s the Difference between a Primary Key and a Unique Key?
32. What is Difference between DELETE  and TRUNCATE Commands?

33. What are Different Types of Locks?
34. What are Pessimistic Lock and Optimistic Lock?
35. When is the use of UPDATE_STATISTICS command?
36. What is the Difference between a HAVING clause and a WHERE clause?
37. What is Connection Pooling and why it is Used?
38. What are the Properties and Different Types of Sub-Queries?
39. What are the Authentication Modes in SQL Server? How can it be Changed?

40. Which Command using Query Analyzer will give you the Version of SQL Server and Operating System?
41. What is an SQL Server Agent?
42. Can a Stored Procedure call itself or a Recursive Stored Procedure? How many levels of SP nesting is possible?
43. What is Log Shipping?
44. Name 3 ways to get an Accurate Count of the Number of Records in a Table?
45. What does it mean to have QUOTED_IDENTIFIER ON? What are the Implications of having it OFF?
46. What is the Difference between a Local and a Global Temporary Table?
47. What is the STUFF Function and How Does it Differ from the REPLACE Function?
48. What is PRIMARY KEY?
49. What is UNIQUE KEY Constraint?
50. What is FOREIGN KEY?

51. What is CHECK Constraint?
52. What is NOT NULL Constraint?
53. What is the difference between UNION and UNION ALL?
54. What is B-Tree?
55. How to get @@ERROR and @@ROWCOUNT at the Same Time?
56. What is a Scheduled Job or What is a Scheduled Task?
57. What are the Advantages of Using Stored Procedures?
58. What is a Table Called, if it has neither Cluster nor Non-cluster Index? What is it Used for?
59. Can SQL Servers Linked to other Servers like Oracle?
60. What is BCP? When is it Used?

61. What Command do we Use to Rename a db, a Table and a Column?
62. What are sp_configure Commands and SET Commands?
63. How to Implement One-to-One, One-to-Many and Many-to-Many Relationships while Designing Tables?
64. What is Difference between Commit and Rollback when Used in Transactions?
65. What is an Execution Plan? When would you Use it? How would you View the Execution Plan?

66. What is Difference between Table Aliases and Column Aliases? Do they Affect Performance?
67. What is the difference between CHAR and VARCHAR Datatypes?
68. What is the Difference between VARCHAR and VARCHAR(MAX) Datatypes?
69. What is the Difference between VARCHAR and NVARCHAR datatypes?
70. Which are the Important Points to Note when Multilanguage Data is Stored in a Table?
71. How to Optimize Stored Procedure Optimization?
72. What is SQL Injection? How to Protect Against SQL Injection Attack?
73. How to Find Out the List Schema Name and Table Name for the Database?
74. What is CHECKPOINT Process in the SQL Server?

75. How does Using a Separate Hard Drive for Several Database Objects Improves Performance Right Away?
76. How to Find the List of Fixed Hard Drive and Free Space on Server?
77. Why can there be only one Clustered Index and not more than one?
78. What is Difference between Line Feed (\n) and Carriage Return (\r)?
79. Is It Possible to have Clustered Index on Separate Drive From Original Table Location?
80. What is a Hint?
81. How to Delete Duplicate Rows?
82. Why the Trigger Fires Multiple Times in Single Login?

83. What is Aggregate Functions?
84. What is Use of @@ SPID in SQL Server?
85. What is the Difference between Index Seek vs. Index Scan?
86. What is the Maximum Size per Database for SQL Server Express?
87. How do We Know if Any Query is Retrieving a Large Amount of Data or very little data?
88. What is the Difference between GRANT and WITH GRANT while Giving Permissions to the User?
89. How to Create Primary Key with Specific Name while Creating a Table?
90. What is T-SQL Script to Take Database Offline – Take Database Online
91. How to Enable/Disable Indexes?
92. Can we Insert Data if Clustered Index is Disabled?
93. How to Recompile Stored Procedure at Run Time?
94. Is there any Performance Difference between IF EXISTS (Select null from table) and IF EXISTS (Select 1 from table)?
95. What is Difference in Performance between INSERT TOP (N) INTO Table and Using Top with INSERT?
96. Does the Order of Columns in UPDATE statements Matter?

97. What are the basic functions for master, msdb, model, tempdb and resource databases?
98. What is the Maximum Number of Index per Table?
99. Explain Few of the New Features of SQL Server 2008 Management Studio
100. Explain IntelliSense for Query Editing
101. Explain MultiServer Query
102. Explain Query Editor Regions
103. Explain Object Explorer Enhancements
104. Explain Activity Monitors

105. What is Service Broker?
106. Where are SQL server Usernames and Passwords Stored in the SQL server?
107. What is Policy Management?
108. What is Database Mirroring?
109. What are Sparse Columns?
110. What does TOP Operator Do?
111. What is CTE?
112. What is MERGE Statement?
113. What is Filtered Index?
114. Which are the New Data Types Introduced in SQL SERVER 2008?

114. What are the Advantages of Using CTE?
115. How can we Rewrite Sub-Queries into Simple Select Statements or with Joins?
116. What is CLR?
117. What are Synonyms?
118. What is LINQ?
119. What are Isolation Levels?
120. What is Use of EXCEPT Clause?
121. What is XPath?
122. What is NOLOCK?
123. What is the Difference between Update Lock and Exclusive Lock?

124. How will you Handle Error in SQL SERVER 2008?
125. What is RAISEERROR? What is RAISEERROR?
126. How to Rebuild the Master Database?
127. What is the XML Datatype?
128. What is Data Compression?
129. What is Use of DBCC Commands?
130. How to Copy the Tables, Schema and Views from one SQL Server to Another?
131. How to Find Tables without Indexes?

132. How to Copy Data from One Table to Another Table?
133. What is Catalog Views?
134. What is PIVOT and UNPIVOT?
135. What is a Filestream?
136. What is SQLCMD?
137. What do you mean by TABLESAMPLE?
138. What is ROW_NUMBER()?
139. What are Ranking Functions?
140. What is Change Data Capture (CDC) in SQL Server 2008?

141. How can I Track the Changes or Identify the Latest Insert-Update-Delete from a Table?
142. What is the CPU Pressure?
143. How can I Get Data from a Database on Another Server?
144. What is the Bookmark Lookup and RID Lookup?
145. What is Difference between ROLLBACK IMMEDIATE and WITH NO_WAIT during ALTER DATABASE?
146. What is Difference between GETDATE and SYSDATETIME in SQL Server 2008?
147. How can I Check that whether Automatic Statistic Update is Enabled or not?
148. How to Find Index Size for Each Index on Table?
149. What is the Difference between Seek Predicate and Predicate?
150. What are Basics of Policy Management?
151. What are the Advantages of Policy Management?

152. What are Policy Management Terms?
153. What is the ‘FILLFACTOR’?
154. Where in MS SQL Server is ’100’ equal to ‘0’?
155. What are Points to Remember while Using the FILLFACTOR Argument?
156. What is a ROLLUP Clause?
157. What are Various Limitations of the Views?
158. What is a Covered index?
159. When I Delete any Data from a Table, does the SQL Server reduce the size of that table?
160. What are Wait Types?
161. How to Stop Log File Growing too Big?
162. If any Stored Procedure is Encrypted, then can we see its definition in Activity Monitor?

Không có nhận xét nào :

Đăng nhận xét