Wednesday, November 29, 2006

 

DBA Job Interview Question #5: Explain the Difference Between VARCHAR and NVARCHAR

Here's question #5 in our series on DBA Job Interview Questions:
What is the difference between VARCHAR and NVARCHAR?
This is somewhat of a tricky question in the respect that the typical answer people will give sounds like they read it from a book - and that's bad. Here's a typical answer: "NVARCHAR is for Unicode data and VARCHAR is for non-Unicode data."

That's certainly correct but, as an interviewer, I would start digging deeper by asking further detail. Yes, you've provided a technically correct answer, but your answer shows no real knowledge other than your having memorized a definition.

What I would like to hear, as the interviewer, is an answer that shows me you know what Unicode data is, when it's used and what scenarios that it is appropriate to use Unicode. If you knew a few "gotchas" and "Best Practices" then I would be even more impressed. I would expect that, after watching my video on COLLATE and How Queries and Table Data Work with Case-Sensitive and Accent-Sensitive Data you'll be very well versed in using Unicode and Non-Unicode data.

The main point of asking this question is to see how "deep" your knowledge of SQL Server's internals is. For me, this question is really four questions:
I can't say that every interviewer that asks this question (the main question) has the same four questions in mind but, if you know the answers to these questions, that means you have a solid understanding of how SQL Server processes string data - that will help you in any SQL interview. Let's cover each of these:
Hope this helps!


Technorati Tags: , , , , ,



Comments: Post a Comment

Links to this post:

Create a Link



<< Home

This page is powered by Blogger. Isn't yours?