Log in
::
Register
::
Not logged in
Home
Tags
Articles
Editorials
Stairways
Forums
Scripts
Videos
Blogs
QotD
Books
Ask SSC
SQL Jobs
Training
Authors
About us
Contact us
Newsletters
Write for us
Recent Posts
Recent Posts
Popular Topics
Popular Topics
Home
Search
Members
Calendar
Who's On
Home
»
SQL Server 2008
»
SQL Server 2008 - General
»
sql logics1
17 posts, Page 1 of 2
1
2
»»
sql logics1
Rate Topic
Display Mode
Topic Options
Author
Message
asranantha
asranantha
Posted Thursday, August 16, 2012 1:35 AM
SSC-Enthusiastic
Group: General Forum Members
Last Login: Yesterday @ 8:20 AM
Points: 162,
Visits: 3,810
hi firend i have small doubt in sql plz tell me answer
Auto commit has been turned off.
1- William logs into the database
2- Julianna logs into the database
3- William sees 12 rows in the TOYS table
4- Isabelle logs into the database
5- Julianna sees 12 rows in the TOYS table
6- William inserts two rows into the TOYS table
7- Julianna inserts 14 rows into the TOYS table
8- Isabelle issues a COMMIT
9- William issues a ROLLBACK
10- Julianna looks at the TOYS table
Based on the scenario above, how many rows does Julianna see in the TOYS table when she looks at it in step 10?
plz tell me the logic .and tell me the process
Post #1345701
GilaMonster
GilaMonster
Posted Thursday, August 16, 2012 2:00 AM
SSC-Dedicated
Group: General Forum Members
Last Login: Today @ 12:59 PM
Points: 37,640,
Visits: 29,895
Interview question? Homework?
That's not hard to implement and test.
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 #1345719
asranantha
asranantha
Posted Thursday, August 16, 2012 5:00 AM
SSC-Enthusiastic
Group: General Forum Members
Last Login: Yesterday @ 8:20 AM
Points: 162,
Visits: 3,810
how can u gues it is interview question? and in case of its interview question why ur not help?ok if u know answer tell me answers its help other wise donot comments unnecessary
Post #1345830
GilaMonster
GilaMonster
Posted Thursday, August 16, 2012 5:21 AM
SSC-Dedicated
Group: General Forum Members
Last Login: Today @ 12:59 PM
Points: 37,640,
Visits: 29,895
Because it's blatantly obvious that it's a set question. We don't just give out answers to interview questions, it doesn't help you learn and I don't need the job.
Seriously, create a table, create three SSMS sessions and do what's in that list and see how many rows. You'll remember the answer (and possibly the reason) far better than if someone just gives you the answer.
Also, read up on transactions and rollbacks for the theory behind why it works
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 #1345852
asranantha
asranantha
Posted Thursday, August 16, 2012 10:30 AM
SSC-Enthusiastic
Group: General Forum Members
Last Login: Yesterday @ 8:20 AM
Points: 162,
Visits: 3,810
answere is 28 rows
here there is no logic just thinking
like this way
first step first persion enter to the database
in second step second persion enter to the database
in third step william sees 12 rows in the toys table that means toys table contain
12 rows
in fourt step third persion log on to the same database
in fifth step second persion sees 12 rows in the toys table that time also toys table
contains 12 rows
in sixth step first persion insert 2 rows into the toyps table that time toys table
contain 14 rows
in sevents step second persion insert 14 rows into the toys table that time toys table
contain 28 rows
in eighth step second persion issues the commit that means all rows are commit
so 28 rows are commit in toys table
in ninth step first pesion issue rollback that time also 28 rows avilable in toys table
in 10th step third persion look to toys table that time he sees 28 rows in toys table
Post #1346114
Lynn Pettis
Lynn Pettis
Posted Thursday, August 16, 2012 10:38 AM
SSC-Insane
Group: General Forum Members
Last Login: Today @ 3:18 AM
Points: 21,588,
Visits: 27,375
asranantha (8/16/2012)
answere is 28 rows
You sure?
Lynn Pettis
For better assistance in answering your questions, click here
For tips to get better help with Performance Problems, click here
For Running Totals and its variations, click here
or
when working with partitioned tables
For more about Tally Tables, click here
For more about Cross Tabs and Pivots, click here
and
here
Managing Transaction Logs
SQL Musings from the Desert
Fountain Valley SQL
(My Mirror Blog)
Post #1346117
SQLKnowItAll
SQLKnowItAll
Posted Thursday, August 16, 2012 10:43 AM
SSCrazy
Group: General Forum Members
Last Login: Tuesday, May 14, 2013 1:40 PM
Points: 2,610,
Visits: 3,116
Second question... What does Isabelle see when she runs a commit?
Also, the question is incomplete. Like asking how many car lengths are between me and that tree over there?... A car is not a unit of length. Looking at a table is not a defined construct. Querying a table is also not a defined construct, as there are several ways to structure that query.
Thanks,
Jared
SQL Know-It-All
How to post data/code on a forum to get the best help - Jeff Moden
Post #1346118
GilaMonster
GilaMonster
Posted Thursday, August 16, 2012 10:55 AM
SSC-Dedicated
Group: General Forum Members
Last Login: Today @ 12:59 PM
Points: 37,640,
Visits: 29,895
So you're saying that if you and I are both making changes to a table at the same time, when you run a commit you also commit my changes and then if I decide that I want to undo my changes, I can't roll them back because you already committed them?
Sure that's how transactions work? (hint, look up the meaning of ACID as it applied to transactions, specifically what the I stands for and means)
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 #1346123
SQLKnowItAll
SQLKnowItAll
Posted Thursday, August 16, 2012 11:02 AM
SSCrazy
Group: General Forum Members
Last Login: Tuesday, May 14, 2013 1:40 PM
Points: 2,610,
Visits: 3,116
1- William logs into the database
2- Julianna logs into the database
3- William sees 12 rows in the TOYS table
How does he "see" 12 rows? SELECT TOP 12? SELECT *? WITH(NOLOCK)? GUI?
4- Isabelle logs into the database
5- Julianna sees 12 rows in the TOYS table
Again... How does she "see" 12 rows? SELECT TOP 12? SELECT *? WITH(NOLOCK)? GUI?
6- William inserts two rows into the TOYS table
7- Julianna inserts 14 rows into the TOYS table
8- Isabelle issues a COMMIT
Isabelle gets an error...
9- William issues a ROLLBACK
10- Julianna looks at the TOYS table
Once again... How does she "see" 12 rows? SELECT TOP 12? SELECT *? WITH(NOLOCK)? GUI?
Thanks,
Jared
SQL Know-It-All
How to post data/code on a forum to get the best help - Jeff Moden
Post #1346126
asranantha
asranantha
Posted Thursday, August 16, 2012 11:24 AM
SSC-Enthusiastic
Group: General Forum Members
Last Login: Yesterday @ 8:20 AM
Points: 162,
Visits: 3,810
why isbbelle gets erroe
and williams inserts 2 rows +julianna insert 12 rows are not lodead in in toy table how u say thatone
Post #1346140
« Prev Topic
|
Next Topic »
17 posts, Page 1 of 2
1
2
»»
Permissions
You
cannot
post new topics.
You
cannot
post topic replies.
You
cannot
post new polls.
You
cannot
post replies to polls.
You
cannot
edit your own topics.
You
cannot
delete your own topics.
You
cannot
edit other topics.
You
cannot
delete other topics.
You
cannot
edit your own posts.
You
cannot
edit other posts.
You
cannot
delete your own posts.
You
cannot
delete other posts.
You
cannot
post events.
You
cannot
edit your own events.
You
cannot
edit other events.
You
cannot
delete your own events.
You
cannot
delete other events.
You
cannot
send private messages.
You
cannot
send emails.
You
may
read topics.
You
cannot
rate topics.
You
cannot
vote within polls.
You
cannot
upload attachments.
You
may
download attachments.
You
cannot
post HTML code.
You
cannot
edit HTML code.
You
cannot
post IFCode.
You
cannot
post JavaScript.
You
cannot
post EmotIcons.
You
cannot
post or upload images.
Copyright © 2002-2013 Simple Talk Publishing. All Rights Reserved.
Privacy Policy.
Terms of Use.
Report Abuse.