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 12345»»»

NULL Values and Joins Expand / Collapse
Author
Message
Posted Saturday, December 18, 2010 3:23 PM
Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Thursday, January 31, 2013 8:01 AM
Points: 1,232, Visits: 1,046
Comments posted to this topic are about the item NULL Values and Joins
Post #1036927
Posted Saturday, December 18, 2010 11:49 PM
SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Wednesday, January 22, 2014 12:48 PM
Points: 229, Visits: 184
I accept I got it wrong, but what do you mean the second transaction fails? Only the insert null into the primary key field statement fails. There are no failed inserts on Table2.
Post #1036950
Posted Sunday, December 19, 2010 6:37 AM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Today @ 11:18 AM
Points: 13,553, Visits: 10,429
Nice question, but only 1 point?

Transactions and the NULL insert in the primary key have actually nothing to do with the actual question, they just serve as trickery in my opinion.
And I don't really get the last line of the explanation. B not C is the correct answer?




How to post forum questions.
Need an answer? No, you need a question.
What’s the deal with Excel & SSIS?

Member of LinkedIn. My blog at LessThanDot.

MCSA SQL Server 2012 - MCSE Business Intelligence
Post #1036965
Posted Monday, December 20, 2010 1:26 AM


Hall of Fame

Hall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of Fame

Group: General Forum Members
Last Login: Today @ 8:37 AM
Points: 3,905, Visits: 5,079
The question itself is acceptable, but, in my opunion, the explanation is somewhat lacking.

____________________________________________
Space, the final frontier? not any more...
All limits henceforth are self-imposed.
“libera tute vulgaris ex”
Post #1037061
Posted Monday, December 20, 2010 1:32 AM
Hall of Fame

Hall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of Fame

Group: General Forum Members
Last Login: Friday, May 9, 2014 12:47 AM
Points: 3,448, Visits: 4,407
No rows were inserted into table2? B not C is the correct answer? Terrible, terrible explanation
Post #1037065
Posted Monday, December 20, 2010 1:40 AM


SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Today @ 1:25 AM
Points: 2,495, Visits: 2,376
vk-kirov (12/20/2010)
No rows were inserted into table2? B not C is the correct answer? Terrible, terrible explanation

The explanation is more terrible than the question: I should read it at least 7 times!
Post #1037066
Posted Monday, December 20, 2010 2:17 AM
SSC Eights!

SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!

Group: General Forum Members
Last Login: Thursday, July 10, 2014 3:13 AM
Points: 990, Visits: 844
I have to disagree with the answer. I ran the code on SQL server 2005 and got the following output:
a	b	c	d
4 join1 4 join2
4 join1 4 join2
2 join3 2 one
2 join3 2 one
1 one NULL NULL
NULL NULL NULL two
NULL NULL NULL three

As I had worked out the same output before running and answering the question I decided that A, B, D and E could not possibly be correct so went for C as the only remaining option.

What have I missed?
Post #1037079
Posted Monday, December 20, 2010 2:26 AM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Today @ 11:18 AM
Points: 13,553, Visits: 10,429
philip.cullingworth (12/20/2010)
I have to disagree with the answer. I ran the code on SQL server 2005 and got the following output:
a	b	c	d
4 join1 4 join2
4 join1 4 join2
2 join3 2 one
2 join3 2 one
1 one NULL NULL
NULL NULL NULL two
NULL NULL NULL three

As I had worked out the same output before running and answering the question I decided that A, B, D and E could not possibly be correct so went for C as the only remaining option.

What have I missed?


Your output has 7 rows and the column d contains "three" for the 7th row, so it should be answer D.




How to post forum questions.
Need an answer? No, you need a question.
What’s the deal with Excel & SSIS?

Member of LinkedIn. My blog at LessThanDot.

MCSA SQL Server 2012 - MCSE Business Intelligence
Post #1037082
Posted Monday, December 20, 2010 2:35 AM
SSC Eights!

SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!

Group: General Forum Members
Last Login: Thursday, July 10, 2014 3:13 AM
Points: 990, Visits: 844
da-zero (12/20/2010)

Your output has 7 rows and the column d contains "three" for the 7th row, so it should be answer D.


But Answer D is
7 rows where column d = three

I only have 1 row where column d = three
Post #1037083
Posted Monday, December 20, 2010 2:45 AM


SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Today @ 1:25 AM
Points: 2,495, Visits: 2,376
philip.cullingworth (12/20/2010)
da-zero (12/20/2010)

Your output has 7 rows and the column d contains "three" for the 7th row, so it should be answer D.


But Answer D is
7 rows where column d = three

I only have 1 row where column d = three

Please, read carefully the question: it asks how many rows are in the results and what is the value of column "d" on the last row.
Post #1037086
« Prev Topic | Next Topic »

Add to briefcase 12345»»»

Permissions Expand / Collapse