SQL Server Interview Questions

Basic SQL Questions
Question 1 :- Explain normalization ?         
| Answer Link | Answer Video Link |
Question 2 :- How to implement normalization ?                                         
| Answer Link | Answer Video Link |
Question 3 :- What is denormalization ?                                                
| Answer Link | Answer Video Link |
Question 4 :- Explain OLTP vs OLAP ?                                                   
| Answer Link | Answer Video Link |
Question 5 :- Explain 1st,2nd and 3rd Normal form ?                                    
| Answer Link | Answer Video Link |   
Question 6 :- Explain DML, DDL, DCL and TCL statements with examples?
| Answer Link | Answer Video Link |
Question 7 :- What is the difference between Drop, Delete and Truncate statements in SQL Server?
| Answer Link | Answer Video Link |
Question 8 :- What is Cascading referential integrity constraint?
| Answer Link | Answer Video Link |
Question 9 :- Difference between primary key and unique key in SQL Server?
| Answer Link | Answer Video Link |
Question 10 :- What is the difference between Having and Where clause
| Answer Link | Answer Video Link |
Question 11 :- What is the use of COALESCE in SQL Server
| Answer Link | Answer Video Link |
Question 12 :- What are the different ways to replace NULL values in SQL Server
| Answer Link | Answer Video Link |
Question 13 :- How can we sort records ?    
| Answer Link | Answer Video Link |
Question 14 :- What is need of Identity ?                                              
| Answer Link | Answer Video Link |
Question 15 :- Explain transactions and how to implement it ?  
| Answer Link | Answer Video Link |
Question 16 :- What's the default sort ?                                                
| Answer Link | Answer Video Link |
Question 17 :- How can we remove duplicates ?                                        
| Answer Link | Answer Video Link |
Question 18 :- How to handle NULLS ?                                                   
| Answer Link | Answer Video Link |
Question 19 :- What is use of wild cards ?                                             
| Answer Link | Answer Video Link |
Question 20 :- What is the use of Alias ?
| Answer Link | Answer Video Link |
Question 21 :- How to write a case statement ?
| Answer Link | Answer Video Link |
Question 22 :- Explain transactions and how to implement it ? 
| Answer Link | Answer Video Link |
 
Questions on Queries
 Question 23 :- Find NTH Highest Salary in SQL.                                         
| Answer Link | Answer Video Link |
Question 24 :- Select the top nth highest salary using correlated Queries?             
| Answer Link | Answer Video Link |
Question 25 :- Select top nth using using TSQL                                         
| Answer Link | Answer Video Link |
Question 26 :- Select the first top X records ?                                        
| Answer Link | Answer Video Link |
Question 27 :- Performance comparison of all the methods.                              
| Answer Link | Answer Video Link |

Questions on Temporary Tables
Question 28 :- What are the 2 types of Temporary Tables in SQL Server?
| Answer Link | Answer Video Link |
Question 29 :- What is the difference between Local and Global Temporary Tables?
| Answer Link | Answer Video Link |
Question 30 :- Can you create foreign key constraints on temporary tables?
| Answer Link | Answer Video Link |
Question 31 :- Do you have to manually delete temporary tables?
| Answer Link | Answer Video Link |
Question 32 :- In which database, the temporary tables get created?
| Answer Link | Answer Video Link |
Question 33 :- How can I check for the existence of a temporary table?
| Answer Link | Answer Video Link |
Question 34 :- What is the difference between a Temporary Table and a Table Variable
| Answer Link | Answer Video Link |


Questions on Indexes
Question 35 :- What is the use of an Index in SQL Server?
| Answer Link | Answer Video Link |
Question 36 :- How does it make search faster?  
Question 37 :- What is a table scan? or What is the impact of table scan on performance?
| Answer Link | Answer Video Link |
Question 38 :- What is the system stored procedure that can be used to list all the indexes that are created for a specific table?
| Answer Link | Answer Video Link |
Question 39 :- What is the purpose of query optimizer in SQL Server?
| Answer Link | Answer Video Link |
Question 40 :- What is the first thing you will check for, if the query below is performing very slow?
| Answer Link | Answer Video Link |
Question 41 :- What is the significance of an Index on the column used in the GROUP BY clause?
| Answer Link | Answer Video Link |
Question 42 :- What is the role of an Index in maintaining a Unique column in table?
| Answer Link | Answer Video Link |
Question 43 :- What are the disadvantages of an Index?
| Answer Link | Answer Video Link |
Question 44 :- What are the 2 types of Indexes in SQL Server?
| Answer Link | Answer Video Link |
Question 45 :- How many Clustered and Non Clustered Indexes can you have per table?
| Answer Link | Answer Video Link |
Question 46 :- Which Index is faster, Clustered or Non Clustered Index?
| Answer Link | Answer Video Link |
Question 47:- When is it usually better to create a unique no clustered index on the primary key column?
| Answer Link | Answer Video Link |
Question 48 :- What is a Composite Index in SQL Server? or What is the advantage of using a Composite Index in SQL 
Server? or What is Covering Query?
| Answer Link | Answer Video Link |
Question 49 :- What is the difference between Index Scan and Index Seek
| Answer Link | Answer Video Link |


Questions on triggers
Question 50 :- What is a Trigger in SQL Server?
| Answer Link | Answer Video Link |
Question 51 :- What are the two types of Triggers in SQL Server?
| Answer Link | Answer Video Link |
Question 52 :- What are the special tables used by Triggers in SQL Server?
| Answer Link | Answer Video Link |
Question 53 :- Give a real time example for triggers usage?
| Answer Link | Answer Video Link |
Question 54 :- What are triggers and why do you need it ?                              
| Answer Link | Answer Video Link |
Question 55 :- What are types of triggers ?                                            
| Answer Link | Answer Video Link |
Question 56 :- Differentiate between After trigger vs Instead Of ?                     
| Answer Link | Answer Video Link |
Question 57 :- What is need of Identity ?                                              
| Answer Link | Answer Video Link | 

Questions on Views
Question 58 :- What is a View in SQL Server?
| Answer Link | Answer Video Link |
Question 59 :- What are the advantages of using views? Or When do you usually use views?
| Answer Link | Answer Video Link |
Question 60 :- Can you create a view based on other views?
| Answer Link | Answer Video Link |
Question 61 :- Can you update views?
| Answer Link | Answer Video Link |
Question 62 :- What are indexed views? Or What are materialized views?
| Answer Link | Answer Video Link |
Question 63 :- What are the limitations of a View?
| Answer Link | Answer Video Link |

Questions on Joins
Question 64 :- What are the different types of joins available in sql server?
| Answer Link | Answer Video Link |
Question 65 :- Outer Join is again divided into 3 types as shown below.
| Answer Link | Answer Video Link |
Question 66 :- What is cross join. Explain with an example?
| Answer Link | Answer Video Link |
Question 67 :- Explain Inner Join with an example
| Answer Link | Answer Video Link |
Question 68 :- Explain Left Outer Join with an example
| Answer Link | Answer Video Link |
Question 69 :- Explain Right Outer Join with an example
| Answer Link | Answer Video Link |
Question 70 :- Explain Full Outer Join with an example
| Answer Link | Answer Video Link |
Question 71 :- Explain Self Join with an example
| Answer Link | Answer Video Link |
Question 72 :- Write a SQL Query to delete from a table that is involved in a SQL join
| Answer Link | Answer Video Link |
Question 73 :- Explain Subquery ?                                                      
| Answer Link | Answer Video Link |
Question 74 :- Can inner Subquery return multiple results ?                            
| Answer Link | Answer Video Link |
Question 75 :- What is Co-related Query ?                                              
| Answer Link | Answer Video Link |
Question 77 :- Differentiate between Joins and Subquery ?                              
| Answer Link | Answer Video Link |
Question 78 :- Performance Joins vs Subquery? 
| Answer Link | Answer Video Link |           

Questions on Stored Procedure and function 
Question 78 :- What are the advantages of using stored procedures
| Answer Link | Answer Video Link |
Question 79 :- Difference between User Defined Function and Stored Procedure
| Answer Link | Answer Video Link |
Question 80 :- Write a Stored Procedure that takes column name as a parameter and returns the result sorted by the column that is passed
| Answer Link | Answer Video Link |
Question 81 :- What is deferred name resolution in SQL Server?
| Answer Link | Answer Video Link |

Questions on string manipulation functions
Question 82 :- Can you list a few useful string manipulation functions in SQL Server?
| Answer Link | Answer Video Link |
Question 83 :- Then he asked me, Can you give me one example of where you have used these functions in your experience?
| Answer Link | Answer Video Link |
Question 84:- Differentiate between Char vs Varchar ?                                  
| Answer Link | Answer Video Link |
Question 85 :- Differentiate between Char vs NChar ?                                    
| Answer Link | Answer Video Link |
Question 86 :- Whats the size of Char vs NChar ? 
| Answer Link | Answer Video Link |

No comments:

Post a Comment

Today Tasks