SQL Server Interview Questions And Answers

  • Hi,

    I want to initiate this topic because I feel we should share our interview question experience so it will help others to face the interview.

    I know that good developers don’t need interview questions. But in general I feel most of the interviewers stuck around some common questions or some common answers and if you are not aware about these questions even though you are very good in your current organization or doing good work you will not be selected.

    So better to read those questions also πŸ™‚

    I have created the blog for the interview questions as per my understanding and interviews faced.

    its http://sqlserverquest.blogspot.com"> http://sqlserverquest.blogspot.com

    I hope people will keep posting more interview questions with solution. will discuss the interview questions and multiple approaches for the same.

    Randheer Singh

    ----------------------------------
    CheckOut My Blog for SQL Server Realated Topics and Interview Questions for SSIS , SSRS and TSQL.

    http://www.sqlserverquest.com/p/ssrs-interview-questions.html
    http://www.sqlserverquest.com/p/ssis-interview-questions.html
    http://www.sqlserverquest.com/p/tsql-interview-questions.html

  • There is nothing wrong with preparing yourself for an interview (you should be), but in my opinion, not knowing all the answers is not that bad.

    If you can show the interviewer that you have good knowledge of the product and that you know how to research "the gaps of your knowledge", you should be fine.

    It is impossible to know everything about SQL Server (except for a few exceptional people), so there is no shame in not knowing an answer (however, it is a shame not knowing any answer :-)).

    If you don't know the answer, write the question down and send an e-mail later to the interviewer with the correct answer and how you researched the problem. I know some people who got the job after this technique.

    Need an answer? No, you need a question
    My blog at https://sqlkover.com.
    MCSE Business Intelligence - Microsoft Data Platform MVP

  • It's very easy for a good interviewer to tell the difference between someone who's memorised answers and someone who know the topic.

    Don't exaggerate your skills.

    Don't lie to the interviewer

    Don't be afraid to say 'I don't know' (but have an idea how you'd find out)

    p.s. I used to ask an 'unanswerable' question in interviews, just to see if the candidate would admit he didn't know or if he'd lie to me.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • p.s. You might want to spend some time validating and expanding the answers to your interview questions. Some are totally wrong, many are so vague as to not be answers.

    eg: (from http://sqlserverquest.blogspot.com/2010/12/sql-server-interview-questions-and_21.html)

    Difference between delete and truncate?

    Data deleted with truncate command cannot be roll back one the transaction is committed. While data deletion with delete command can be roll back even if the transaction is committed.

    That's incorrect on both points.

    What are indexes in SQL Server?

    Indexes are used to search the data in the database in well-mannered approach. Data can be searched by user without going into entire database.

    Errr.....

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • How sql server retrieves the next identity value for delete command used in table as deleted rows are moved to log.

    i just want to understand the actual process.

    Randheer Singh

    ----------------------------------
    CheckOut My Blog for SQL Server Realated Topics and Interview Questions for SSIS , SSRS and TSQL.

    http://www.sqlserverquest.com/p/ssrs-interview-questions.html
    http://www.sqlserverquest.com/p/ssis-interview-questions.html
    http://www.sqlserverquest.com/p/tsql-interview-questions.html

  • parmar.randheer11 (2/3/2011)


    How sql server retrieves the next identity value for delete command used in table as deleted rows are moved to log.

    i just want to understand the actual process.

    I don't really see what IDENTITY has to do with the DELETE command, except that it can create gaps in your sequence.

    Need an answer? No, you need a question
    My blog at https://sqlkover.com.
    MCSE Business Intelligence - Microsoft Data Platform MVP

  • Scenario Based Questions

    Suppose you have the table having identity column.

    You delete the last row from the table which having identity value suppose 10 and then insert a new row in table. The new identity value which will get inserted in the table will be the next value i.e. 11.

    So the question is that from where sql server reads the old identity value 10 (as data already deleted) and generates the new identity 11 accordingly to insert into table

    SQL Server interview Questions and Answers

    http://sqlserverquest.blogspot.com

    Randheer Singh

    ----------------------------------
    CheckOut My Blog for SQL Server Realated Topics and Interview Questions for SSIS , SSRS and TSQL.

    http://www.sqlserverquest.com/p/ssrs-interview-questions.html
    http://www.sqlserverquest.com/p/ssis-interview-questions.html
    http://www.sqlserverquest.com/p/tsql-interview-questions.html

  • One very common question asked by interviewers is:

    CAST versus CONVERT in SQL Server

  • SQLSmasher (2/10/2011)


    One very common question asked by interviewers is:

    CAST versus CONVERT in SQL Server

    That is not a question!

    If you haven't even tried to resolve your issue, please don't expect the hard-working volunteers here to waste their time providing links to answers which you could easily have found yourself.

  • It is quite good question for initial telephonic interview. And you can give simple answer by

    1. CONVERT is SQL speicific but CAST is ANSI standarised

    2. CONVERT deal nicely with datetime using format, which is missing from CAST

  • SQLSmasher (2/10/2011)


    One very common question asked by interviewers is:

    CAST versus CONVERT in SQL Server

    And even if it was, it would be a lousy one.

    If I'd want to check syntax and functionalities, I'd look it up in BOL, not memorize it.

    Need an answer? No, you need a question
    My blog at https://sqlkover.com.
    MCSE Business Intelligence - Microsoft Data Platform MVP

  • SQLSmasher (2/10/2011)


    It is quite good question for initial telephonic interview. And you can give simple answer by

    1. CONVERT is SQL speicific but CAST is ANSI standarised

    2. CONVERT deal nicely with datetime using format, which is missing from CAST

    1. You mean specific to the TSQL dialect.

    2. In that case, a better question would be: "How would you format a datetime value to the ISO compliant format?"

    Need an answer? No, you need a question
    My blog at https://sqlkover.com.
    MCSE Business Intelligence - Microsoft Data Platform MVP

  • Koen Verbeeck

    - Da-Zero is dead! πŸ™‚

    If you haven't even tried to resolve your issue, please don't expect the hard-working volunteers here to waste their time providing links to answers which you could easily have found yourself.

  • Phil Parkin (2/10/2011)


    Koen Verbeeck

    - Da-Zero is dead! πŸ™‚

    The name is indeed, quite dead. I decided it was time to grow up and lose the nickname I invented when I was 12 years old πŸ™‚

    But the avatar remains! πŸ˜€

    Need an answer? No, you need a question
    My blog at https://sqlkover.com.
    MCSE Business Intelligence - Microsoft Data Platform MVP

  • Koen Verbeeck (2/10/2011)


    Phil Parkin (2/10/2011)


    Koen Verbeeck

    - Da-Zero is dead! πŸ™‚

    The name is indeed, quite dead. I decided it was time to grow up and lose the nickname I invented when I was 12 years old πŸ™‚

    But the avatar remains! πŸ˜€

    That's a shame - it was quite a snappy nom de plume. My nickname aged 12 was much more offensive and would probably get me censored on SSC! Now I've just got to work out how to pronounce your surname :hehe:

    If you haven't even tried to resolve your issue, please don't expect the hard-working volunteers here to waste their time providing links to answers which you could easily have found yourself.

Viewing 15 posts - 1 through 15 (of 33 total)

You must be logged in to reply to this topic. Login to reply