FullStackFSCCafé
 
 
Sign in with GoogleSign in with Google. Opens in new tab
Kill Your Tech Interview
3877 Full-Stack, Algorithms & System Design Interview Questions
Answered To Get Your Next Six-Figure Job Offer
      
🤖 Having Machine Learning & DS Interview? Check  MLStack.Cafe - 1704 Data Science & ML Interview Questions & Answers!Having ML & DS Interview? Check 🤖 MLStack.Cafe - 1704 ML & DS Interview Questions and Answers

Top 52 T-SQL Interview Questions

Entry Junior Mid Senior Expert
Sign in with GoogleSign in with Google. Opens in new tab
Topic Progress:

Theoretical Questions

Q1:   

Mention what is TOP in T-SQL?

  
Add to PDF   Entry 
Q2:   

Is it possible to rename a database?  If so, how would you rename the database?

  
Add to PDF   Entry 
Q3:   

What is Blocking?

  
Add to PDF   Junior 
Q4:   

What is the difference between Data Definition Language (DDL) and Data Manipulation Language (DML)?

  Related To: MySQL, SQL, Databases
Add to PDF   Junior 
Q5:   

Mention what is OFFSET-FETCH filter in tsql?

  
Add to PDF   Junior 
Q6:   

Mention what is Subquery?

  
Add to PDF   Junior 
Q7:   

What are the two commands to remove all of the data from a table?  Are there any implications with the specific commands?

  
Add to PDF   Junior 
Q8:   

What are the three ways that Dynamic SQL can be issued?

  
Add to PDF   Junior 
Q9:   

Mention what are the limitations of IDENTITY column?

  
Add to PDF   Junior 
Q10:   

What’s the difference between a Local Temp Table and a Global Temp Table?

  
Add to PDF   Junior 
Q11:   

When should I use primary key or index?

  
Add to PDF   Junior 
Q12:   

Name 5 commands that can be used to manipulate text in T-SQL code

  
Add to PDF   Junior 
Q13:   

Could you explain the difference between Primary Key and Unique Index?

  
Add to PDF   Junior 
Q14:   

What are the new error handling commands introduced with SQL Server 2005 and beyond?

  
Add to PDF   Junior 
Q15:   

Explain what are the differences between SQL and T-SQL?

  
Add to PDF   Junior 
Q16:   

What is TSQL Window functions?

  
Add to PDF   Junior 
Q17:   

What is a Cursor and how does it work?

  
 Add to PDF   Mid 
Q18:   

What’s the difference between Azure SQL Database and Azure SQL Managed Instance?

  Related To: Azure, SQL
 Add to PDF   Mid 
Q19:   

What are the advantages of using Stored Procedures?

  
 Add to PDF   Mid 
Q20:   

What are bitwise operators and what is the value from a database design perspective?

  
 Add to PDF   Mid 
Q21:   

Mention what are ROLLUP and CUBE in T-SQL?

  
 Add to PDF   Mid 
Q22:   

How do I perform an IF…THEN in an SQL SELECT?

  
 Add to PDF   Mid 
Q23:   

What's the difference between TRUNCATE and DELETE in SQL?

  
 Add to PDF   Mid 
Q24:   

How can you delete duplicate records in a table with no primary key?

  
 Add to PDF   Mid 
Q25:   

Mention what are the Join Types in TSQL?

  
 Add to PDF   Mid 
Q26:   

What are types of XML indexes in SQL Server?

  
 Add to PDF   Mid 
Q27:   

What two commands were released in SQL Server 2005 related to comparing data sets from two or more separate SELECT statements? 

  
 Add to PDF   Mid 
Q28:   

Mention what is uncommittable transactions?

  
 Add to PDF   Mid 
Q29:   

What are Row Constructors?

  
 Add to PDF   Mid 
Q30:   

In what version of SQL Server were synonyms released, what do synonyms do and when could you make the case for using them?

  
 Add to PDF   Mid 
Q31:   

Is there a difference between T-SQL linked server and a synonym?

  
 Add to PDF   Mid 
Q32:   

Mention what does the T-SQL command IDENT_CURRENT does?

  
 Add to PDF   Mid 
Q33:   

Explain Function vs. Stored Procedure in SQL Server

  
 Add to PDF   Mid 
Q34:   

What are the practical differences between COALESCE() and ISNULL(,'')?

  
 Add to PDF   Mid 
Q35:   

Is it possible to import data directly from T-SQL commands without using SQL Server Integration Services?  If so, what are the commands?

  
 Add to PDF   Senior 
Q36:   

What is a Filegroup?

  
 Add to PDF   Senior 
Q37:   

What is the difference between PARTITION BY and GROUP BY

  
 Add to PDF   Senior 
Q38:   

Name some types of Triggers

  
 Add to PDF   Senior 
Q39:   

What is the difference between EXEC vs sp_executesql?

  
 Add to PDF   Senior 
Q40:   

What do Clustered and Non Clustered index actually mean?

  
 Add to PDF   Senior 
Q41:   

What is the use of GO in Transact SQL?

  
 Add to PDF   Senior 
Q42:   

What is a Linked Server?

  
 Add to PDF   Senior 
Q43:   

From a T-SQL perspective, how would you prevent T-SQL code from running on a production SQL Server?

  
 Add to PDF   Expert 
Q44:   

What is the native system stored procedure to issue a command against all databases?

  
 Add to PDF   Expert 
Q45:   

What are the best practices for using a GUID as a primary key, specifically regarding performance?

  
 Add to PDF   Expert 
Q46:   

Why you should never use GUIDs as part of clustered index?

  Related To: Databases, MySQL, PostgreSQL
 Add to PDF   Expert 
Q47:   

Is it correct/best practice to have the TRY/CATCH block inside the transaction or should the transaction be inside the TRY block?

  
 Add to PDF   Expert 

Code Challenges

Q1:   

Provide an example of Left Outer Join with Exclusions

  
  Add to PDF   Mid 
Q2:   

How do I UPDATE from a SELECT in SQL Server?

  
  Add to PDF   Mid 
Q3:   

How can you capture the length of a column when it is a Text, NText and/or Image data type?

  
  Add to PDF   Mid 
Q4:   

How does TRUNCATE and DELETE operations effect Identity?

  Related To: SQL
  Add to PDF   Senior 
Q5:   

Insert results of a stored procedure into a temporary table

  
  Add to PDF   Expert 
 

Rust has been Stack Overflow’s most loved language for four years in a row and emerged as a compelling language choice for both backend and system developers, offering a unique combination of memory safety, performance, concurrency without Data races...

Clean Architecture provides a clear and modular structure for building software systems, separating business rules from implementation details. It promotes maintainability by allowing for easier updates and changes to specific components without affe...

Azure Service Bus is a crucial component for Azure cloud developers as it provides reliable and scalable messaging capabilities. It enables decoupled communication between different components of a distributed system, promoting flexibility and resili...

Cosmos DB has gained popularity among developers and organizations across various industries, including finance, e-commerce, gaming, IoT, and more. Follow along and learn the 24 most common and advanced Azure Cosmos DB interview questions and answers...
More than any other NoSQL database, and dramatically more than any relational database, MongoDB's document-oriented data model makes it exceptionally easy to add or change fields, among other things. It unlocks Iteration on the project. Iteration f...
Unit Tests and Test Driven Development (TDD) help you really understand the design of the code you are working on. Instead of writing code to do something, you are starting by outlining all the conditions you are subjecting the code to and what outpu...
Domain-Driven Design is nothing magical but it is crucial to understand the importance of Ubiquitous Language, Domain Modeling, Context Mapping, extracting the Bounded Contexts correctly, designing efficient Aggregates and etc. before your next DDD p...
At its core, Microsoft Azure is a public cloud computing platform - with solutions including Infrastructure as a Service (IaaS), Platform as a Service (PaaS), and Software as a Service (SaaS) that can be used for services such as analytics, virtual c...
As an asynchronous event-driven JavaScript runtime, Node.js is designed to build scalable network applications. Follow along to refresh your knowledge and explore the 52 most frequently asked and advanced Node JS Interview Questions and Answers every...
Dependency Injection is most useful when you're aiming for code reuse, versatility and robustness to changes in your problem domain. DI is also useful for decoupling your system. DI also allows easier unit testing without having to hit a database and...