Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Transaction Processing Consider the following oversimplified schema for a database to store a social network of friends and the Web pages they like. CREATE TABLE

image text in transcribed

Transaction Processing Consider the following oversimplified schema for a database to store a social network of friends and the Web pages they like. CREATE TABLE Friend (uid1 int, uid2 int); CREATE TABLE Likes (uid int, URL char (120)); CREATE VIEW LikeCount AS SELECT uid, count (*) AS cnt FROM Likes GROUP BY uid; Consider the following transactions: T1: SELECT count (*) FROM Likes WHERE uid-1234 T2 INSERT INTO Likes (uid, URL) VALUES (1234, "") T3 SELECT cnt FROM LikeCount WHERE uid-1234 (1234, "URL2>"; Suppose the scheduler accepts the three transactions at the same time, and assigns their start time as follows: start(T)=t; start(T)=t+1; start(Ta)=t+2, form some timestamp t. (13) (2 marks) Describe a concurrency control mechanism and a sequence of events that when applied to the scenario above would allow the three transactions to execute concurrently, COMMIT in the absence of system failures, and in a way that the values returned by T1 and T3 are the same. Your answer can involve any of the mechanisms discussed in class. Transaction Processing Consider the following oversimplified schema for a database to store a social network of friends and the Web pages they like. CREATE TABLE Friend (uid1 int, uid2 int); CREATE TABLE Likes (uid int, URL char (120)); CREATE VIEW LikeCount AS SELECT uid, count (*) AS cnt FROM Likes GROUP BY uid; Consider the following transactions: T1: SELECT count (*) FROM Likes WHERE uid-1234 T2 INSERT INTO Likes (uid, URL) VALUES (1234, "") T3 SELECT cnt FROM LikeCount WHERE uid-1234 (1234, "URL2>"; Suppose the scheduler accepts the three transactions at the same time, and assigns their start time as follows: start(T)=t; start(T)=t+1; start(Ta)=t+2, form some timestamp t. (13) (2 marks) Describe a concurrency control mechanism and a sequence of events that when applied to the scenario above would allow the three transactions to execute concurrently, COMMIT in the absence of system failures, and in a way that the values returned by T1 and T3 are the same. Your answer can involve any of the mechanisms discussed in class

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions

Question

overloading a circuit can occur from

Answered: 1 week ago

Question

Explain the key areas in which service employees need training.

Answered: 1 week ago

Question

Understand the role of internal marketing and communications.

Answered: 1 week ago