Interview Questions and Answers are now updated with the latest questions and answers. New Location: SQL Server Interview Questions and Answers.
Click here to get free chapters (PDF) in the mailbox

Thank you all for your appreciation about the my recent series of SQL Server Interview Questions and Answers. I enjoyed writing questions and answers. I have gotten many emails about complete series.
Top most requests were to collect series in one big post so they can be easily used. I was asked to provide links to download them so they can be printed and referred.
Another question I received is done I ask the same questions in interviews which I administrate. The answer is YES. Though, I have a few other questions, which I ask. All of them, I came up myself and answers are unique to questions and not available on-line. Well, long story short, I have compiled list of questions in one PDF. Please download them and use them in your next interview or just for reading purpose.
An interview Question and Answer discussion can be very helpful to both these individuals. It is simply a way to go back over the building blocks of a topic. Many times a simple review like this will help “jog” your memory, and all those previously-memorized facts will come flooding back to you. It is not a way to re-learn a topic, but a way to remind yourself of what you already know.
Download SQL Server Interview Question and Answers Complete List
Complete Series of SQL Server Interview Questions and Answers
Introduction, Part 1, Part 2, Part 3, Part 4, Part 5, Part 6
SQL Server Interview Question and Answers Complete List Download
Other popular Series
SQL SERVER Database Coding Standards and Guidelines Complete List Download
SQL SERVER – Data Warehousing Interview Questions and Answers Complete List Download
Connect with me on Twitter.
Reference: Pinal Dave (https://blog.sqlauthority.com)






282 Comments.
Dave,
Our school has blocked your site. We have to use it through proxy. my school IT dept sez that your list of sql question has few question which are in our course. i think your question are generic and are basic to any database course. It may be useful to us in future but at moment we can learn database course by reading it. few questions are very difficult and may be used in future.
My school IT dept is not smart as I read your site from either proxy or from home. my frends from dorm can not use it. See my email address above it is incorrect but if domain is correct. Please contact our IT dept so we can see your site from dorm. they need letter from CS dept so go to cs.schooldomain.edu and contact us to see the information.
good work. Like your questions.
Thanks Dave,
For helping me.
It’s really very informatics website and question and answered have been given in detail, thanks for providing us so nice materials.
A really nice work which would help in general Database related question in Interview.
Keep it up and let us updated as well.
Thanks for providing good and varied amount of q/a on SQL Server.
Thanks Pinal Dave it is very helpful for my interview Preparations.
good
thanks for queries and answers
hello sir, iam premkuar. i want sql query.
Thanks for regarding these information & quries
Thanks for regarding these information & quries
Its really nice and helpful for us
Thank u
Hi Mr. Dave,
Could you help me with multiple sub queries of SQL. It will be great help if you could send them to my mail id.
Anthony
Hi there Pinal,
Interesting set of questions. Must take quite a while to go through all of them in an interview – our set is aimed at jumping in at the deeper end, because we are consultants, and require a stronger level. That said, I sometimes worry that ‘skipping’ some of the more basic concepts, means that we could allow people to ‘slip through’.
Regarding the questions, some comments (possibly a few posts, rather than 1 long comment). these are given in the interest of sharing.
Truncate:
-You state truncate CANNOT be rolled back. That is incorrect when tested on SQL 2000 (SP4) and SQL 2005 (sp2a):
create table I (i int)
insert into I(i) values (1)
go
set nocount on
select i ‘BEforeTruncate’ from I
begin tran
truncate table I
select i ‘afterTruncateBeforeRollback’ from I
rollback
select i ‘AfterTruncate’ from I
–results:
BEforeTruncate
————–
1
afterTruncateBeforeRollback
—————————
AfterTruncate
————-
1
Note that after the rollback, the table again has the row.
…hmm, message seems to have been truncated. The full quote, again, for review:
What is the difference between a local and a global variable?
A local temporary table exists only for the duration of a connection or, if defined inside a compound
statement, for the duration of the compound statement.
A global temporary table remains in the database permanently, but the rows exist only within a given
connection. When connection are closed, the data in the global temporary table disappears. However,
the table definition remains with the database for access when database is opened next time.
Hi! All
Pls help me to resolve Following issue:
I want to drop contraint defind on a FIELD OF table AND WANT TO ALTER LENGTH OF THAT FILED in 15-20 database having same schema without every time changing constraint’S unique id w.r.t to database using following command
ALTER TABLE MYTABLE DROP CONSTRAINT CONS1
ALTER TABLE MYTABLE ADD CONS_COL VARCHAR(50)
It is not executing/error encountered
Can you please send me the complete collection of your SQL server Questions.
Thanks in Advance
Dave,
I have a question ?
when a dead loack occurs one process is choosen as dead lock victim against another process.
The process that is choosen as dead lock victim gets rolled back. Can we set the dead locked process to re-run automatically after waiting for certain time ?
Please help with an example if possible.
Thanks Again !!!
hi Pinal Dave
excelent job..u r a real database guru..keep it up..
thnaks for helping ..
Thanks Dave,
Very Helpfull for me