SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Few tricky Questions about SQL Server 2008 that I came across...


Few tricky Questions about SQL Server 2008 that I came across...

Author
Message
GilaMonster
GilaMonster
SSC Guru
SSC Guru (228K reputation)SSC Guru (228K reputation)SSC Guru (228K reputation)SSC Guru (228K reputation)SSC Guru (228K reputation)SSC Guru (228K reputation)SSC Guru (228K reputation)SSC Guru (228K reputation)

Group: General Forum Members
Points: 228567 Visits: 46342
If I got those from a company prior to an interview, I would think twice (or more) about whether I wanted to work there. Whoever wrote those questions has no clue about SQL, they are so way wrong it's not even funny.

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


brendan woulfe
brendan woulfe
SSC Eights!
SSC Eights! (932 reputation)SSC Eights! (932 reputation)SSC Eights! (932 reputation)SSC Eights! (932 reputation)SSC Eights! (932 reputation)SSC Eights! (932 reputation)SSC Eights! (932 reputation)SSC Eights! (932 reputation)

Group: General Forum Members
Points: 932 Visits: 1087
GilaMonster (1/10/2012)
JagWalia (1/10/2012)

[quote][b]Q. Which of the following statements can be used to provide sorted result set based in the CustomerName column?

A. SELECT ROW_NUMBER() AS RN, CustomerName from Customers order by CustomerName
B. SELECT ROW_NUMBER() OVER (ORDER BY CustomerName) AS RN, CustomerName FROM Customers
C. SELECT ROW_NUMBER() (ORDER BY CustomerName) AS RN, from Customers
D. SELECT ROW_NUMBER() AS RN, CustomerName from Customers


None of them.

If that was a sample test or some training material that you bought, get a refund.


Curious as to why you said none of them. The question is worded in a way that it can be read differently. I was thinking one of them is right though, without giving that one away.
Jared Karney
Jared Karney
SSChampion
SSChampion (13K reputation)SSChampion (13K reputation)SSChampion (13K reputation)SSChampion (13K reputation)SSChampion (13K reputation)SSChampion (13K reputation)SSChampion (13K reputation)SSChampion (13K reputation)

Group: General Forum Members
Points: 13884 Visits: 3697
JagWalia (1/10/2012)
GilaMonster, thanks for replying those questions. I got these questions prior to the interview. I can see login ID question is a syntax issue and I can find the correct one on the net but rest of them are something I am not sure of.


I don't mean to sound arrogant or mean, but if you cannot intelligently come up with a response to those questions as to why they are wrong or why the answers are not complete you should pass on this job. If not to save yourself from a job fit that is not right for you, do it for the people that you will have to work with.

Thanks,
Jared
PFE - Microsoft
SQL Know-It-All
How to post data/code on a forum to get the best help - Jeff Moden
Evil Kraig F
Evil Kraig F
SSC-Insane
SSC-Insane (21K reputation)SSC-Insane (21K reputation)SSC-Insane (21K reputation)SSC-Insane (21K reputation)SSC-Insane (21K reputation)SSC-Insane (21K reputation)SSC-Insane (21K reputation)SSC-Insane (21K reputation)

Group: General Forum Members
Points: 21055 Visits: 7660
brendan woulfe (1/10/2012)
GilaMonster (1/10/2012)
JagWalia (1/10/2012)

[quote][b]Q. Which of the following statements can be used to provide sorted result set based in the CustomerName column?

A. SELECT ROW_NUMBER() AS RN, CustomerName from Customers order by CustomerName
B. SELECT ROW_NUMBER() OVER (ORDER BY CustomerName) AS RN, CustomerName FROM Customers
C. SELECT ROW_NUMBER() (ORDER BY CustomerName) AS RN, from Customers
D. SELECT ROW_NUMBER() AS RN, CustomerName from Customers


None of them.

If that was a sample test or some training material that you bought, get a refund.


Curious as to why you said none of them. The question is worded in a way that it can be read differently. I was thinking one of them is right though, without giving that one away.

Not a single one has an Order By clause. You cannot guarantee an ordered result. It's a syntax question for the use of ROW_NUMBER(), but is pointless without the final outer ORDER BY clause.


- Craig Farrell

Never stop learning, even if it hurts. Ego bruises are practically mandatory as you learn unless you've never risked enough to make a mistake.

For better assistance in answering your questions | Forum Netiquette
For index/tuning help, follow these directions. |Tally Tables

Twitter: @AnyWayDBA
Evil Kraig F
Evil Kraig F
SSC-Insane
SSC-Insane (21K reputation)SSC-Insane (21K reputation)SSC-Insane (21K reputation)SSC-Insane (21K reputation)SSC-Insane (21K reputation)SSC-Insane (21K reputation)SSC-Insane (21K reputation)SSC-Insane (21K reputation)

Group: General Forum Members
Points: 21055 Visits: 7660
This one makes me laugh:


Q: Which of the following is an improved performance feature that uses bitmap filters for selecting minimal rows with queries?
A. Table partitions
B. Star Join
C. Where clause
D. Outer Join

That's just hysterical. It's bad enough few enough people understand what a bitmap does and how bit/byte comparisons work, but... WOW. ROFL


- Craig Farrell

Never stop learning, even if it hurts. Ego bruises are practically mandatory as you learn unless you've never risked enough to make a mistake.

For better assistance in answering your questions | Forum Netiquette
For index/tuning help, follow these directions. |Tally Tables

Twitter: @AnyWayDBA
SQLRNNR
SQLRNNR
SSC Guru
SSC Guru (67K reputation)SSC Guru (67K reputation)SSC Guru (67K reputation)SSC Guru (67K reputation)SSC Guru (67K reputation)SSC Guru (67K reputation)SSC Guru (67K reputation)SSC Guru (67K reputation)

Group: General Forum Members
Points: 67579 Visits: 18570
GilaMonster (1/10/2012)
If I got those from a company prior to an interview, I would think twice (or more) about whether I wanted to work there. Whoever wrote those questions has no clue about SQL, they are so way wrong it's not even funny.


Sounds like a bunch of questions coming from a recruiter.

We could make them funny:-D

No. Seriously, I would probably poke a lot of fun at them.Hehe



Jason AKA CirqueDeSQLeil
I have given a name to my pain...
MCM SQL Server, MVP


SQL RNNR

Posting Performance Based Questions - Gail Shaw

brendan woulfe
brendan woulfe
SSC Eights!
SSC Eights! (932 reputation)SSC Eights! (932 reputation)SSC Eights! (932 reputation)SSC Eights! (932 reputation)SSC Eights! (932 reputation)SSC Eights! (932 reputation)SSC Eights! (932 reputation)SSC Eights! (932 reputation)

Group: General Forum Members
Points: 932 Visits: 1087
brendan woulfe (1/10/2012)
GilaMonster (1/10/2012)
JagWalia (1/10/2012)

[quote][b]Q. Which of the following statements can be used to provide sorted result set based in the CustomerName column?

A. SELECT ROW_NUMBER() AS RN, CustomerName from Customers order by CustomerName
B. SELECT ROW_NUMBER() OVER (ORDER BY CustomerName) AS RN, CustomerName FROM Customers
C. SELECT ROW_NUMBER() (ORDER BY CustomerName) AS RN, from Customers
D. SELECT ROW_NUMBER() AS RN, CustomerName from Customers


None of them.

If that was a sample test or some training material that you bought, get a refund.


Curious as to why you said none of them. The question is worded in a way that it can be read differently. I was thinking one of them is right though, without giving that one away.


Yeah, that's what I was thinking. Just wanted to make sure it was the "sorted result" part of the question that lead her to say none of them is all.
LutzM
LutzM
SSC-Insane
SSC-Insane (24K reputation)SSC-Insane (24K reputation)SSC-Insane (24K reputation)SSC-Insane (24K reputation)SSC-Insane (24K reputation)SSC-Insane (24K reputation)SSC-Insane (24K reputation)SSC-Insane (24K reputation)

Group: General Forum Members
Points: 24125 Visits: 13559
@Craig: Answer A has an ORDER BY but invalid syntax.

The problem in general from my point of view:
There's a company looking for someone with decent SQL skills since they obviously don't have anybody at the team yet. Or they're trying to ask a bunch of trick questions just for the fun of it, and missed to include the fun part.
But if you (JagWalia) cannot spot the errors in the questions/answers and provide a reason why those are wrong, you're probably not the one they're looking for. The company seems to look for someone to teach, not to learn...



Lutz
A pessimist is an optimist with experience.

How to get fast answers to your question
How to post performance related questions
Links for Tally Table , Cross Tabs and Dynamic Cross Tabs , Delimited Split Function
JagWalia
JagWalia
SSC Journeyman
SSC Journeyman (99 reputation)SSC Journeyman (99 reputation)SSC Journeyman (99 reputation)SSC Journeyman (99 reputation)SSC Journeyman (99 reputation)SSC Journeyman (99 reputation)SSC Journeyman (99 reputation)SSC Journeyman (99 reputation)

Group: General Forum Members
Points: 99 Visits: 93
I am going to address these questions and answers to the employer. I had 39 questions and 33 out of those were correct, however these are the ones that caught me off guard. And I just want to make sure before addressing it to the employer.
Evil Kraig F
Evil Kraig F
SSC-Insane
SSC-Insane (21K reputation)SSC-Insane (21K reputation)SSC-Insane (21K reputation)SSC-Insane (21K reputation)SSC-Insane (21K reputation)SSC-Insane (21K reputation)SSC-Insane (21K reputation)SSC-Insane (21K reputation)

Group: General Forum Members
Points: 21055 Visits: 7660
LutzM (1/10/2012)
@Craig: Answer A has an ORDER BY but invalid syntax.

My foot tastes GREAT! I think I'll swallow to the knee next time.

The problem in general from my point of view:
There's a company looking for someone with decent SQL skills since they obviously don't have anybody at the team yet. Or they're trying to ask a bunch of trick questions just for the fun of it, and missed to include the fun part.
But if you (JagWalia) cannot spot the errors in the questions/answers and provide a reason why those are wrong, you're probably not the one they're looking for. The company seems to look for someone to teach, not to learn...

+1

I'd definately have to agree with this. I wouldn't trust the rest of the questions offhand either.


- Craig Farrell

Never stop learning, even if it hurts. Ego bruises are practically mandatory as you learn unless you've never risked enough to make a mistake.

For better assistance in answering your questions | Forum Netiquette
For index/tuning help, follow these directions. |Tally Tables

Twitter: @AnyWayDBA
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search