Top 20 SQL Server Interview Questions & How To Answer Them

Two people talking

So, you have an upcoming job interview where you'll be asked to demonstrate your knowledge of SQL Server. The first thing to do? Don't stress out! After all, if your potential employers didn't think you had the baseline qualifications, they wouldn't have asked you to come in to talk with them at all.

That said, everyone's nervous with a job interview on the horizon even under the best of circumstances. No matter how well you know your field, you always worry about being tripped up by the way a specific question is asked. That's why it's good to overprepare as a way of easing your stress.

With that in mind, here are 20 SQL Server interview questions with answers to help calm your nerves and make you feel as confident as possible.

What Is SQL Server?

Developed by Microsoft, SQL Server is a relational database management system (RDBMS). Its primary job is to store and retrieve information from databases as requested by other software applications. SQL Server is server-based software which means these requests may come from applications on the same computer, across a local-area or wide-area network, or even the internet.

There are at least a dozen different versions of SQL Server available on the market. These range from licenses for a single machine to internet-connected applications with thousands ? or more! ? simultaneous users.

20 SQL Server Interview Questions & Answers

Woman holding laptop beside glass wall

No one expects your knowledge of SQL Server to be encyclopedic. Making sure you have the answers below on the tip of your tongue, however, will help you appear both confident and well prepared. After all, you don't want to fumble around trying to brain out every answer from scratch like it?s the first time you've been asked basic SQL Server interview questions.

1. What Are The Possible Index Configurations For A Table?

There are 5 different types of table index configurations:

  • Clustered index
  • Non-clustered index
  • Clustered index and multiple non-clustered indexes
  • Multiple non-clustered indexes
  • No indexes

A clustered index rearranges a table based on the order of the index. A non-clustered index does not do this.

2. What Are The Different Types Of Recovery Models And How Many Can A database Have?

The SQL Server recovery model determines what data is kept and for how long in the transaction log file. Each database is only allowed to have a single recovery model even though there are 3 different types available:

  • Bulk-logged
  • Full
  • Simple

3. What Is A Relational Database Management System (RDBMS) And What Are The properties Of Its tables?

An RDBMS stores data in table form. Different relationships can be defined between tables as data can be recombined from different tables. These relational tables have 6 basic properties:

  • Column values are the same type
  • Each column is required to have a unique name
  • Each row is unique
  • Sequence of columns is unimportant
  • Sequence of rows is unimportant
  • Values are atomic (that is, values cannot be divided)

4. What Are The Primary Differences Between Oracle And SQL Server?

Oracle supports all Linux and Unix platforms while SQL Server only supports Windows Server. Oracle replicates both databases and instances, but SQL Server just replicates databases. Oracle has an average ease of use, but SQL Server?s is better. Oracle uses an open-source license, and SQL Server is available only through a commercial license.

5. What Are The Different Ways To Secure SQL Server?

There are 7 basic ways to secure SQL Server:

  • Disable Guest account to enable auditing via multiprotocol encryption
  • Employ an unusable System Administrator (SA) password to restrict physical SQL Server access
  • Prefer New Technology (NT) authentication
  • Rename Admin account on SQL Server machine
  • Secure physical database files with New Technology File System (NTFS) permissions
  • Set up Secure Sprockets Layer (SSL), firewalls, and isolate the web server from SQL Server
  • Use application, database, and server roles to restrict data access

6. What Is The strongest Encryption Key In SQL Server DBA?

Computer codes

Use the 256-bit Advanced Encryption Standard (AES) as opposed to Data Encryption Standard (DES) as it employs an older and less robust algorithm. The longer the key, the better the encryption. Then again, the longer the key, the larger the performance penalty.

7. Can Upgrade Advisor Analyze Remote Instances?

This is something of a trick question. Yes, Upgrade Advisor can do this except for one exception: SQL Server Reporting Services. In this case, Upgrade Advisor has to be installed on the report server to analyze Reporting Services.

8. What Is SQL Profiler?

The system administrator can monitor events in SQL Server using the Profiler tool. The data captured about each table or file event can then be examined and analyzed at a later date via graphical representation. Specific data can also be captured using filters.

9. How Many Different Types Of Subqueries Are There?

This question can be answered two different ways. On the one hand, SQL Server has 3 kinds of subqueries:

  • Single row subquery: returns a single row
  • Multiple column subquery: returns multiple columns for execution by a main query
  • Multiple row subquery: returns multiple rows

On the other hand, SQL Server also has correlated and non-correlated subqueries. The former refers to a subquery which selects data referenced in a main query. The latter is when a main query substitutes output from a subquery.

10. What Is A Trigger And How Many Types Are There?

Triggers automatically execute batch SQL code when a table is modified. There are three types:

  • Data Definition Language (DDL): triggered when changes to database definitions occur even though data is not changed
  • Data Manipulation Language (DBL): triggered when insert, delete, or update commands modify a table
  • Logon: trigged due to a logon event before a user session is set up

11. What Is Collation And What Are The Different Types?

Collation is used to define a table's sort order and how the data will be compared such as by character sequence, case, width, and other factors. There are 3 sort order types:

  • Binary
  • Case insensitive
  • Case sensitive

12. Is A NULL Value The Same As A Blank Space Or Zero?

No. After all, a blank space is actually a character, and zero is a number. In contrast, a NULL value is one which is unknown, unassigned, unavailable, or not applicable.

13. How Many Editions Of SQL Server 2017 Are Currently Available?

There are currently 4 editions available:

  • Developer: Build, demonstrate, and test applications in a non-production setting
  • Enterprise: Support the high-performance Tier 1 database as well as advanced analytics and business intelligence applications
  • Express: Build mobile and web applications up to 10 GB big
  • Standard: Achieve optimal performance of mid-tier applications and can be upgraded to the Enterprise edition with no coding changes required

14. What Are The Different Levels Of Constraint?

There are two levels of constraint: table level and column level.

15. What Are The Different Column Constraints?

There are 6 different types of constraints:

  • Check Constraint
  • Default Constraint
  • Foreign Key Constraint
  • Not Null Constraint
  • Primary Key Constraint
  • Unique Constraint

16. Why Is Replication Necessary With SQL Server?

Computer screen

Replication synchronizes data across multiple servers. This also requires the use of a replica set.

17. What Is The Difference Between A Field And A Table?

A field is a column in a table. Tables are composed of one or more fields.

18. What Does ACID Stand For?

ACID is the acronym for atomicity, consistency, isolation, and durability.

19. A Table's Unique Records Can Be Selected With What Keyword?

The DISTINCT keyword allows you to capture specific types of data from a table.

20. What Are The Different Kinds Of User-Defined Functions (UDFs)?

There are 3 kinds of UDFs:

  • Inline table valued
  • Multi-statement valued
  • Scalar

The first two functions return tables while scalar returns the unit.

Be Ready For Your Interview 

Of course, no matter what job you're applying for, potential employers will want to know more about you than just your answers to the SQL Server interview questions above. They're also curious to find out what kind of person you are, how well you'll fit into their corporate culture, and what you bring to the table as a team member. Here are some resources to help you prepare for those components of the interview:

Two person shaking each others hands

In the end, you want to present yourself in both an honest and well-rounded manner. That is, you don't want to make yourself appear to be someone you aren't. ?At the same time, you want potential employers to see all the things you can offer through the position you're applying for. After that, all you can do is the best you can and see how things come out in the wash.

Have an upcoming interview where you'll need to demonstrate your knowledge of Linux? Check out these 20 Linux questions with answers to help you prepare!

Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.