Google Answers Logo
View Question
 
Q: Database 2 ( Answered 5 out of 5 stars,   0 Comments )
Question  
Subject: Database 2
Category: Computers
Asked by: eksolutions-ga
List Price: $10.00
Posted: 04 Dec 2002 14:12 PST
Expires: 03 Jan 2003 14:12 PST
Question ID: 119314
The questions are based on the following relational schema:

Emp( eid: integer, ename: string, age : integer, salary: real, did:
integer )

Dept( did: integer, dname: string, floor : integer)

and on the following update command:

replace(salary=1.1*EMP.salary) where EMP.ename=’Santa’

a. Give an example of a query that would conflict with this command
(in a concurrency control sense) if both were run at the same time.
Explain what would go wrong, and how locking tuples would solve the
problem.
b. Give an example of a query or a command that would conflict with
this command, such that the conflict could not be resolved by just
locking individual tuples or pages, but requires index locking.
c. Explain what index locking is and how it resolves the preceding
conflict.
Answer  
Subject: Re: Database 2
Answered By: maniac-ga on 04 Dec 2002 17:34 PST
Rated:5 out of 5 stars
 
Hello Eksolutions,

A very interesting question to research. If you search with the
phrases
  database update query conflict locking tuples
on Google, the highest ranking match has homework answers to a very
similar question (and the original PDF has been moved or deleted). It
is available from the Google cache at:
http://216.239.39.100/search?q=cache:4SdiXL-oEBQC:www.cs.columbia.edu/~gce3/4111m02/docs/hw5sol.pdf+database+update+query+conflict+locking+tuples&hl=en&ie=UTF-8

Scroll down near the end to question #4 (items a, b, and c).

In the same way, the second ranking match at
  http://www.cs.ualberta.ca/~yuan/courses/391/02fall/assignment/solasn01sp/
has question #8 which appears to be the same question with a slightly
different set of answers (and doesn't answer your "c").

The remaining references provide additional material to explain the
concepts involved.

  --Maniac

Request for Answer Clarification by eksolutions-ga on 04 Dec 2002 17:48 PST
How do you know that the question 4 in the first link you have
provided is the same question as mine?

Clarification of Answer by maniac-ga on 04 Dec 2002 18:22 PST
Hello Eksolutions,

To answer "How do I know it is the same question?"...

Use the search query I provided
  database update query conflict locking tuples

with Google. You should get the PDF file I referred to in the answer
as well as a related page from the same site. Look at the related page
in the Google cache at
http://216.239.51.100/search?q=cache:1GCrRCC51E4C:www.cs.columbia.edu/~gce3/4111m02/docs/hw5.pdf+database+update+query+conflict+locking+tuples&hl=en&ie=UTF-8

to see the original questions. I should have checked and included that
reference in my original answer. Sorry.

The clue I had to the "similar" question was the arithmetic in the
answers where the query has both a *2 and *1.1 in the calculations.
The answers also fit the questions you provided.

  --Maniac
eksolutions-ga rated this answer:5 out of 5 stars

Comments  
There are no comments at this time.

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  


Google Home - Answers FAQ - Terms of Service - Privacy Policy