Congrats on finishing the Semester. I hope you enjoy your summer!
Category: Uncategorized
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?
Which of the following is an example of a dirty read?
Which of the following is an example of a dirty read?
Refer to the tables. What will the following select statemen…
Refer to the tables. What will the following select statement return? SELECT SUM(P.UnitPrice * S.Quantity) AS TotalSales FROM Sales S INNER JOIN Product P ON S.ProductId = P.ProductId;
Refer to the following tables: Employee ID Name Salary…
Refer to the following tables: Employee ID Name Salary 4428 Amin Shah 42500 5993 Malia Tarkas 53000 Student ID Name Scholarship 1408 Indira 3000 5993 Malia Tarkas 7110 Jiho Chen 4500 How many rows are in the table defined by the following relational algebra expression?
According to our class discussions the following Relational…
According to our class discussions the following Relational Algebra expression displays what kind of join?
Complete the ORDER BY clause to sort the Products by Product…
Complete the ORDER BY clause to sort the Products by ProductName alphabetically, then Quantity from the smallest to the largest. SELECT ProductName, Size, Quantity, SupplierId FROM Product ORDER BY _____ ;
Evaluate the SQL statement and data below. What is correct r…
Evaluate the SQL statement and data below. What is correct result?