February 11, 2013 at 8:19 pm
Comments posted to this topic are about the item The Lonely and Neglected Cartesian Product (Cross Join)
February 11, 2013 at 8:20 pm
Thanks .. nice clear question about something I needed to learn ...
Now my question to you: Is the company sponsored employee & spouse/partner formal dinner and dance, a benefit enjoyed in a bygone era?
Not for all companies, seems that the smaller companies continue the tradition, while the larger ones neglect their employees by eliminating some of the "perks"
February 11, 2013 at 9:15 pm
bitbucket-25253 (2/11/2013)
Thanks .. nice clear question about something I needed to learn ...Now my question to you: Is the company sponsored employee & spouse/partner formal dinner and dance, a benefit enjoyed in a bygone era?
Not for all companies, seems that the smaller companies continue the tradition, while the larger ones neglect their employees by eliminating some of the "perks"
+1
nice and clear options too :w00t: :-P:-D
~ demonfox
___________________________________________________________________
Wondering what I would do next , when I am done with this one :ermm:
February 11, 2013 at 10:38 pm
Very good question.
And way of explanation is awesome.
Thanks & keep it up!
Vinay ๐
Thanks
Vinay Kumar
-----------------------------------------------------------------
Keep Learning - Keep Growing !!!
February 11, 2013 at 11:00 pm
Thanks for the nice question Thomas ๐
~ Lokesh Vij
Link to my Blog Post --> www.SQLPathy.com[/url]
Follow me @Twitter
February 11, 2013 at 11:28 pm
bitbucket-25253 (2/11/2013)
Thanks .. nice clear question about something I needed to learn ...Now my question to you: Is the company sponsored employee & spouse/partner formal dinner and dance, a benefit enjoyed in a bygone era?
Not for all companies, seems that the smaller companies continue the tradition, while the larger ones neglect their employees by eliminating some of the "perks"
ding ding ding - +1
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
February 12, 2013 at 12:51 am
Good question and background info to something (which if carefully used) that can be very useful
-------------------------------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
February 12, 2013 at 1:37 am
Thank you, Thomas for the question, was set nicely.
With all the information provided and the associated non SQL section - I did not use any of my intelligence (what I have) but just counted the output columns which was 2 and then matched the same with the SQL query which was then 3rd query and yes... i made my 2 points. ๐
First thing I did was see the meaning of this word "Cartesian" (Noun - A follower of Descartes.)
Now I will read all the provided links.
ww; Raghu
--
The first and the hardest SQL statement I have wrote- "select * from customers" - and I was happy and felt smart.
February 12, 2013 at 1:42 am
Wow, amazing question. Are you an MCQA (Microsoft Certified QotD Architect)?
Best Regards,
Chris Bรผttner
February 12, 2013 at 2:06 am
This was removed by the editor as SPAM
February 12, 2013 at 3:29 am
Nice question..
--
Dineshbabu
Desire to learn new things..
February 12, 2013 at 3:36 am
Now my question to you: Is the company sponsored employee & spouse/partner formal dinner and dance, a benefit enjoyed in a bygone era?
"company sponsored"... does not compute??#!? I have to buy my own coffee!
:crying:
Thanks for the question, very educational.
February 12, 2013 at 4:06 am
I selected "none of these are correct".
The first two are wrong for the reasons stated in the answer.
The third is wrong because the requirements are that the three rows for each person are produced with a 1 on the first row, 2 on the second, and 3 on the third. There is nothing in the proposed "third query attempt" which guarantees this ordering within the rows for each individual.
It sorts by t1.pk (and attempts to sort at a lower level by t1.column1 , although there can be no circumstances where two rows in the output have different values for t1.column1 but the same values for t1.pk, since pk is defined as the primary key)
This guarantees that the three rows for each person are listed together, but does not sort them into any particular order. You might get the order you want, but you can't be sure.
February 12, 2013 at 4:32 am
Great question! I just recently started using cross joins and am seeing their beauty. This was an amazingly timed QotD for me.
As for company parties, I believe they are going the way of VHS tapes.
February 12, 2013 at 5:13 am
archie flockhart (2/12/2013)
The third is wrong because the requirements are that the three rows for each person are produced with a 1 on the first row, 2 on the second, and 3 on the third. There is nothing in the proposed "third query attempt" which guarantees this ordering within the rows for each individual.It sorts by t1.pk (and attempts to sort at a lower level by t1.column1 , although there can be no circumstances where two rows in the output have different values for t1.column1 but the same values for t1.pk, since pk is defined as the primary key)
This guarantees that the three rows for each person are listed together, but does not sort them into any particular order. You might get the order you want, but you can't be sure.
+1
I had a guess between Query 3, and None of them. I went for Query 3, thinking that the processing of the cross join would probably do an internal Sort (or just read the data from the primary index). But on reflection I should probably have gone for the 'wrong' answer, since although this is what happens in practice, it is not guaranteed based on the SQL.
The correct query would have
order by t1.PK, t2.PK
Viewing 15 posts - 1 through 15 (of 34 total)
You must be logged in to reply to this topic. Login to reply