Consider table Orders(id, amount) where id is a key. Initial…

Consider table Orders(id, amount) where id is a key. Initially, the table contains two rows: (1, 100), (2, 200). Two transactions execute concurrently as follows: T1 (Repeatable Read): Update Orders Set amount = amount + 50 Where id = 1;Delete From Orders Where id = 2;Commit; T2 (Read Committed): Select Sum(amount) As total1 From Orders;Select Sum(amount) As total2 From Orders;Commit; Assume each individual statement is atomic.  Assume each transaction runs to completion and no rollback occures. What possible pairs of values (total1, total2) might T2 return? 

We are a new travel website which offers exclusive discounts…

We are a new travel website which offers exclusive discounts from our partner resorts and tour groups to discerning clients that have a credit card with our parent corporation.  The number of offerings is not huge because we target only high end properties and exclusive tour groups for out clients.  We want to calculate the best index to make in our database to maximize performance for our customers who can assess the database through our website and view our travel offerings. Bookings are done in another systems once a customer is ready to book. We estimate that all of the database transaction for the table we are currently interested in can be placed into three query types. Q1: Queries that our clients execute that accesses information about travel destinations in a specific category (skiing, diving, adventure, luxury travel etc) Q2: Queries that our clients execute that access information about activities in a specific location which are broken down into either city or subcity sections depending on the city size (, Tokyo Ginza area, London Mayfair, Concord, Tampa etc) Q3: Queries that our sales team performs that add new resorts and tours organization to our partnership data base so the customers can discovery them.  Because we are new the addition of new clients has been rapid Assumptions about the data.  We have grown considerably and this table is currently 40 pages in length so if we have to access the entire database it required 40 pages reads. On average a location has 5 partner offerings and each category of offering is available in 20 different locations. Make the assumption that if we know the locations of each partner we still make 5 disk access for Q2 and if we know the locations of the offerings  in each category 20 disk access are required for Q1. One disk access is required to read any index we use and if we modify the database we must also modify the index (requiring both a read and a write (2 disk access)). We will also assume that if we modify the database we can find a blank page and will only require one disk access to read the page and one to write back the modified page. Given these assumptions would it be better to use no index, one index on locations, one index on offerings, or two indexes (both offerings and locations)? Action Frequency No index Index on offerings Index on Location Both index Q1: Category .30         Q2: Location .60         Q3: Update .10         Average           Calculate the average for each of the 4 options.  What is the lowest average (report to 1 decimal place e.g. XX.x)?

Consider two concurrent transactions on a table Department(n…

Consider two concurrent transactions on a table Department(name, budget), where each transaction is declared as Serializable and contains only read operations: T1:BEGIN TRANSACTION;Q1: SELECT MAX(salary) FROM Employee;– additional read-only queriesCOMMIT;T2:BEGIN TRANSACTION;Q2: SELECT MAX(salary) FROM Employee;– additional read-only queriesCOMMIT; Suppose both transactions T1 and T2 execute with isolation level Serializable. Consider scenarios (a), (b), (c) and (d) above for all other transactions in the system. For which of the below scenarios, if any, are we guaranteed to always get the same result for Q1 and Q2 (CHECK ALL THAT APPLY-Points deducted for incorrect checks, minimum score is zero)?

Consider table Worker(name,pay) where name is a key, and the…

Consider table Worker(name,pay) where name is a key, and the following two concurrent transactions.   T1:   Begin Transaction   S1: update Worker set pay = 2*pay where name = ‘Amy’   S2: update Worker set pay = 3*pay where name = ‘Amy’   Commit T2:   Begin Transaction   S3: update Worker set pay = pay-20 where name = ‘Amy’   S4: update Worker set pay = pay-10 where name = ‘Amy’   Commit Assume that the individual statements S1, S2, S3, and S4 always execute atomically. Let Amy’s pay be 50 before either transaction begins execution. Suppose both transactions T1 and T2 execute to completion with isolation level Read-Committed.  What are the possible values for Amy’s final pay?