Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase ««1234»»»

Few tricky Questions about SQL Server 2008 that I came across... Expand / Collapse
Author
Message
Posted Tuesday, January 10, 2012 3:34 PM


SSC-Forever

SSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-Forever

Group: General Forum Members
Last Login: Today @ 3:52 AM
Points: 42,445, Visits: 35,501
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 2008, MVP
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

Post #1233601
Posted Tuesday, January 10, 2012 3:41 PM
SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Friday, July 18, 2014 6:11 AM
Points: 208, Visits: 1,023
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.
Post #1233605
Posted Tuesday, January 10, 2012 3:46 PM


SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Today @ 9:10 AM
Points: 2,691, Visits: 3,372
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
SQL Know-It-All

How to post data/code on a forum to get the best help - Jeff Moden
Post #1233608
Posted Tuesday, January 10, 2012 3:49 PM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Today @ 1:55 AM
Points: 6,142, Visits: 7,195
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
Post #1233613
Posted Tuesday, January 10, 2012 3:51 PM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Today @ 1:55 AM
Points: 6,142, Visits: 7,195
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
Post #1233614
Posted Tuesday, January 10, 2012 3:51 PM


SSC-Insane

SSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-Insane

Group: General Forum Members
Last Login: Yesterday @ 7:44 PM
Points: 21,209, Visits: 14,899
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

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




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


SQL RNNR

Posting Performance Based Questions - Gail Shaw
Posting Data Etiquette - Jeff Moden
Hidden RBAR - Jeff Moden
VLFs and the Tran Log - Kimberly Tripp
Post #1233615
Posted Tuesday, January 10, 2012 3:55 PM
SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Friday, July 18, 2014 6:11 AM
Points: 208, Visits: 1,023
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.
Post #1233616
Posted Tuesday, January 10, 2012 3:55 PM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Today @ 1:04 AM
Points: 7,019, Visits: 12,913
@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
Post #1233617
Posted Tuesday, January 10, 2012 4:23 PM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Monday, March 18, 2013 8:43 PM
Points: 19, 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.

Post #1233624
Posted Tuesday, January 10, 2012 4:33 PM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Today @ 1:55 AM
Points: 6,142, Visits: 7,195
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
Post #1233629
« Prev Topic | Next Topic »

Add to briefcase ««1234»»»

Permissions Expand / Collapse