SQL Interview Questions and Answers for Experienced - 1

Question: 1

What is the difference between UNIQUE and PRIMARY KEY?

  • The UNIQUE KEY column restricts entry of duplicate values but entry of NULL value is allowed.
  • In case of PRIMARY KEY columns entry of duplicate as well as value is also restricted.

Question: 2

What is a cursor?

  • An entity that maps over a result set and establishes a position on a single row within the result set.
  • After the cursor is positioned on a row, operations can be performed on that row, or on a block of rows starting at that position.
  • The most common operation is to fetch (retrieve) the current row or block of rows.

Question: 3

What is a view?

  • A view is a database object that is a logical representation of a table.
  • It is derived from a table but has no storage space of its own and often may be used in the same manner as a table.

Question: 4

What is a pre-requisite for connection pooling?

Multiple processes must agree that they will share the same connection, where every parameter is the same, including the security settings.

Question: 5

Which are the default databases get installed with the MSSQL installation?

  • Master
  • Model
  • msdb
  • Northwind
  • Pubs
  • tempdb

Related Questions