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 Monday, December 20, 2010 3:19 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, February 20, 2014 1:35 AM
Points: 945, Visits: 834
Carlo Romagnano (12/20/2010)

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.


That will teach me. I read the code and assumed what the actual question would be. Can I blame being up in the middle of the night defrosting water pipes?
Post #1037094
Posted Monday, December 20, 2010 3:24 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: Thursday, April 10, 2014 7:08 AM
Points: 3,448, Visits: 4,406
philip.cullingworth (12/20/2010)
But Answer D is
7 rows where column d = three

I only have 1 row where column d = three

I had read the answers several times before I realized there were some skipped words: "7 rows where [the value of] column d [in the last row] = three"
Post #1037095
Posted Monday, December 20, 2010 3:53 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Sunday, January 02, 2011 11:50 PM
Points: 5, Visits: 7
I don't understand how the first transaction could succeed given the attempt to insert the null value into the not-null field "a". Also, why is the last insert of the second transaction, VALUES(2 ,'one'), invalid? Help, I'm confused.
Post #1037104
Posted Monday, December 20, 2010 3:57 AM


SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: 2 days ago @ 3:30 AM
Points: 2,389, Visits: 2,281
ian.grace (12/20/2010)
I don't understand how the first transaction could succeed given the attempt to insert the null value into the not-null field "a". Also, why is the last insert of the second transaction, VALUES(2 ,'one'), invalid? Help, I'm confused.

As posted above by vk-kirov and others, the explanation is terrible with a lot of mistakes.

Post #1037106
Posted Monday, December 20, 2010 4:06 AM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Today @ 2:44 PM
Points: 12,180, Visits: 9,132
ian.grace (12/20/2010)
I don't understand how the first transaction could succeed given the attempt to insert the null value into the not-null field "a". Also, why is the last insert of the second transaction, VALUES(2 ,'one'), invalid? Help, I'm confused.


The first transaction succeeds because it is an explicit transaction. Those will only fail if you explicitly issue a ROLLBACK statement, which isn't the case. Since a COMMIT was issued, the 2 other INSERTS in the transaction are committed to the database.




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 #1037108
Posted Monday, December 20, 2010 4:14 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Sunday, January 02, 2011 11:50 PM
Points: 5, Visits: 7
Thanks for that
Post #1037113
Posted Monday, December 20, 2010 5:44 AM
SSC-Addicted

SSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-Addicted

Group: General Forum Members
Last Login: Wednesday, April 09, 2014 3:10 AM
Points: 469, Visits: 538
so the correct answer should be: "7 rows where the last row's column d = three", not: "7 rows where column d = three", going by the way the question is phrased none of the answers are correct.
Post #1037133
Posted Monday, December 20, 2010 6:11 AM
SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Today @ 11:52 AM
Points: 2,919, Visits: 2,511
Good Monday morning question - math test and logic while clearing the cobwebs and trying to get my first cup of coffee

Made me think, question and reread.


Steve Jimmo
Sr DBA
“If we ever forget that we are One Nation Under God, then we will be a Nation gone under." - Ronald Reagan
Post #1037141
Posted Monday, December 20, 2010 6:23 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: 2 days ago @ 10:58 AM
Points: 819, Visits: 832
I'm completely confused by this explanation. Especially this part:

However, since the last insert in the second Transaction was invalid, no rows were inserted into table2. So B not C is the correct answer.

But D is given as the correct answer, and as far as I can tell, rows are inserted into table2. What am I missing?

Ron


-----
a haiku...

NULL is not zero
NULL is not an empty string
NULL is the unknown
Post #1037146
Posted Monday, December 20, 2010 7:08 AM
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
I agree that if you read the question the answer is obvious.

However there is a HUGE typo in the explination...
B not C is the Answer?

Disapointing.
Post #1037171
« Prev Topic | Next Topic »

Add to briefcase ««12345»»»

Permissions Expand / Collapse