Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Develop query1a.sql and query1b.sql using Microsoft SQL Server Management Studio-AdvantureWorks2019 such that there will be a deadlock independent of order of execution of these 2

Develop query1a.sql and query1b.sql using Microsoft SQL Server Management Studio-AdvantureWorks2019 such that there will be a deadlock independent of order of execution of these 2 queries. Note that, once a query is executed other query should be executed immediately after it with minimal delay (in default isolation level: Read Committed). Then, suggest 2 different approaches to avoid deadlock for these queries such that first approach is fast but does not guarantees data integrity and second approach guarantees data integrity while being a bit slower. Need very soon!!!

Query details should be designed. Modify given queries below with requirements described.

Example query1a.sql:

BEGIN TRAN UPDATE Sales.Customer SET ModifiedDate = '01.01.2010' WHERE CustomerID IN (SELECT CustomerID + 5 FROM Sales.Customer WITH(REPEATABLEREAD) WHERE CustomerID BETWEEN 1 AND 5) WAITFOR DELAY '00:00:10' ROLLBACK

Example query1b.sql:

SELECT CustomerID , TerritoryID , ModifiedDate FROM Sales.Customer WHERE CustomerID IN (7,8)

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

Recommended Textbook for

Sams Teach Yourself Beginning Databases In 24 Hours

Authors: Ryan Stephens, Ron Plew

1st Edition

067232492X, 978-0672324925

More Books

Students also viewed these Databases questions

Question

=+Are you interested in working on global teams?

Answered: 1 week ago

Question

=+Do you want to work from home?

Answered: 1 week ago

Question

=+ What skills and competencies will enable someone

Answered: 1 week ago