Mssql Interview Questions

Mssql Interview Questions

There are a dozen of editions of Microsoft SQL server in the market, which targets different audiences and workloads of all interfaces ranging from the small single interface applications to large interface application with lots of concurrent users.

With lots of scope in the industry, the candidates aiming to cruise with the knowledge of MSSQL can get an extra pair of hands with these interview questions to crack the interview.

MSSQL Interview Questions and answers

Download Mssql Interview Questions PDF

Mssql Interview Questions

Subquery – It is a query which is used when expressions are allowed and can be nested inside the main query like SELECT, UPDATE, DELETE or INSERT statements.
Properties:
  • A subquery in the main query that has to be placed on the right-hand side of the comparison operator
  • A subquery has to be placed parenthesis, in order to get executed first before the main query.
  • It cannot have any order by clause.
  • More than one subquery can be included in the main query.
The types of Subqueries are:
  • Single Row – It returns only one row.
  • Multiple Row – It returns multiple rows.
  • Multiple Column – It returns multiple columns to the main query.
Trigger – It is used to execute a batch of SQL code when the commands like INSERT, UPDATE or DELETE are executed against a table.
They are automatically executed or triggered when the data gets modified.
Types of Triggers:
  • Insert
  • Update
  • Delete
  • Instead of
Collation – It is defined to specify the sort order and there are three sort orders.
  • Binary
  • Case sensitive
  • Case insensitive.

Recursive stored procedure – It is defined as a process of resolving a problem where the solution occurs repetitively.This can be nested up to 32 levels.

When the triggers are fired for any DML command, insert and delete tables are created, these tables are called Magic tables in SQL server.These tables are used inside the triggers for transactions.
Local temporary table – These tables are invisible when there is a connection and are deleted when it is closed.

Global temporary table – These tables are visible to all users and are deleted when the connection is closed.