November 12, 2014 at 6:18 am
Ed Wagner (11/12/2014)
vivekjamshedpur (11/12/2014)
Both choice 3 and 4 is correct.Because author does not say duplicate names are ok.:crazy:No, they aren't. He even bolded the word "all" in the question. Even without bolding it, it would have still meant the same thing.
Or put it another way, there are 4 records that are either grant or steve, therefore 6 that aren't.
Irrespective of name, returning all the employees who aren't called grant or steve, should return 6 rows, using distinct doesn't.
-------------------------------Posting Data Etiquette - Jeff Moden [/url]Smart way to ask a question
There are naive questions, tedious questions, ill-phrased questions, questions put after inadequate self-criticism. But every question is a cry to understand (the world). There is no such thing as a dumb question. ― Carl Sagan
I would never join a club that would allow me as a member - Groucho Marx
November 12, 2014 at 6:18 am
Stuart Davies (11/12/2014)
It was sparked by new dev here, who couldn't see the difference between any of the four possible answers :w00t:As the question and answer showed mixed cases, case insensitivity is implied, again something missed by our now ex dev.
Wow, that's rough. Your company must believe it's easier to hire a new dev than train an existing dev. :blink:
November 12, 2014 at 6:24 am
Dave62 (11/12/2014)
Stuart Davies (11/12/2014)
It was sparked by new dev here, who couldn't see the difference between any of the four possible answers :w00t:As the question and answer showed mixed cases, case insensitivity is implied, again something missed by our now ex dev.
Wow, that's rough. Your company must believe it's easier to hire a new dev than train an existing dev. :blink:
This was just part of a much bigger picture regarding them and their becoming an ex employee. But dirty washing and all that . . . . .
-------------------------------Posting Data Etiquette - Jeff Moden [/url]Smart way to ask a question
There are naive questions, tedious questions, ill-phrased questions, questions put after inadequate self-criticism. But every question is a cry to understand (the world). There is no such thing as a dumb question. ― Carl Sagan
I would never join a club that would allow me as a member - Groucho Marx
November 12, 2014 at 7:14 am
Thanks for the great question!
November 12, 2014 at 7:22 am
From my standpoint :
It should not be a programmer's responsibility (alas it sometimes is) to figure out what some quirky piece of code might be doing,
but to express his ideas in a natural way, so there is only one candiddate worth considering - guess which.
November 12, 2014 at 7:24 am
h.tobisch (11/12/2014)
From my standpoint :It should not be a programmer's responsibility (alas it sometimes is) to figure out what some quirky piece of code might be doing,
but to express his ideas in a natural way, so there is only one candiddate worth considering - guess which.
If the programmer doesn't figure out what the code is doing, then who does? Who wrote the code in the first place?
November 12, 2014 at 7:36 am
Impossible. There are multiple correct answers.
JK
Ducks and runs - snigger.:-D:-D:-D:hehe:
Jason...AKA CirqueDeSQLeil
_______________________________________________
I have given a name to my pain...MCM SQL Server, MVP
SQL RNNR
Posting Performance Based Questions - Gail Shaw[/url]
Learn Extended Events
November 12, 2014 at 8:39 am
Ed Wagner (11/12/2014)
h.tobisch (11/12/2014)
From my standpoint :It should not be a programmer's responsibility (alas it sometimes is) to figure out what some quirky piece of code might be doing,
but to express his ideas in a natural way, so there is only one candiddate worth considering - guess which.
If the programmer doesn't figure out what the code is doing, then who does? Who wrote the code in the first place?
Agreed. It's often my job to figure out what some quirky piece of code is doing. Of course, if I'm really doing my job, I'll document it so the next person doesn't have to figure it out.
November 12, 2014 at 8:43 am
marcia.j.wilson (11/12/2014)
Ed Wagner (11/12/2014)
h.tobisch (11/12/2014)
From my standpoint :It should not be a programmer's responsibility (alas it sometimes is) to figure out what some quirky piece of code might be doing,
but to express his ideas in a natural way, so there is only one candiddate worth considering - guess which.
If the programmer doesn't figure out what the code is doing, then who does? Who wrote the code in the first place?
Agreed. It's often my job to figure out what some quirky piece of code is doing. Of course, if I'm really doing my job, I'll document it so the next person doesn't have to figure it out.
I couldn't agree more about the comments. Before we learned that lesson, how many times have we looked at our own code from 4 years ago and wondered what we were trying to accomplish? It was more than a few times for me, but I don't have to deal with that now that the lesson sunk in.
In general, how many times does a DBA have to figure out what's going on? I guess it depends on how often we're asked to help others or work with code - either our own or code from others.
November 12, 2014 at 8:47 am
Nice, easy question, Stuart. I also noticed the case difference and thought I would mention it in my reply if nobody else did, but of course I wasn't the first to notice that.
It's unfortunate that some developers can't see the difference between those expressions. A firm grasp of basic Boolean algebra should be a prerequisite for any developer, and understanding what DISTINCT does in a SQL statement should be a prerequisite for any database developer.
November 12, 2014 at 8:57 am
SQLRNNR (11/12/2014)
Impossible. There are multiple correct answers.JK
Ducks and runs - snigger.:-D:-D:-D:hehe:
Like... what?? If you don't present your case and argue why you think so, then why bother writing a comment here?
November 12, 2014 at 8:57 am
Yes, the question and possible answers are not aligned. All queries return employee names, not employee (entities). Therefore no answer can be correct.
November 12, 2014 at 8:59 am
hjp (11/12/2014)
SQLRNNR (11/12/2014)
Impossible. There are multiple correct answers.JK
Ducks and runs - snigger.:-D:-D:-D:hehe:
Like... what?? If you don't present your case and argue why you think so, then why bother writing a comment here?
There are always multiple correct answers. Some may perform better than others and some may be more maintainable than others, but there are always multiple ways to get to the right answer. The trick lies in finding the best one.
November 12, 2014 at 9:24 am
hjp (11/12/2014)
SQLRNNR (11/12/2014)
Impossible. There are multiple correct answers.JK
Ducks and runs - snigger.:-D:-D:-D:hehe:
Like... what?? If you don't present your case and argue why you think so, then why bother writing a comment here?
Hint in the JK and the smileys.
It was a Joke.
Jason...AKA CirqueDeSQLeil
_______________________________________________
I have given a name to my pain...MCM SQL Server, MVP
SQL RNNR
Posting Performance Based Questions - Gail Shaw[/url]
Learn Extended Events
November 12, 2014 at 9:27 am
SQLRNNR (11/12/2014)
hjp (11/12/2014)
SQLRNNR (11/12/2014)
Impossible. There are multiple correct answers.JK
Ducks and runs - snigger.:-D:-D:-D:hehe:
Like... what?? If you don't present your case and argue why you think so, then why bother writing a comment here?
Hint in the JK and the smileys.
It was a Joke.
Phew - that's a relief - I didn't know if I should respond to it or not and didn't know how to put my argument! 😉
-------------------------------Posting Data Etiquette - Jeff Moden [/url]Smart way to ask a question
There are naive questions, tedious questions, ill-phrased questions, questions put after inadequate self-criticism. But every question is a cry to understand (the world). There is no such thing as a dumb question. ― Carl Sagan
I would never join a club that would allow me as a member - Groucho Marx
Viewing 15 posts - 16 through 30 (of 43 total)
You must be logged in to reply to this topic. Login to reply