Lab5

docx

School

Boston University *

*We aren’t endorsed by this school

Course

669

Subject

Economics

Date

Jan 9, 2024

Type

docx

Pages

7

Uploaded by MajorMuleMaster1001

Report
1.
2. Firstly, write a subquery that selects the currency ratio, it is found by joining the store_location and Currency. Then, search for Digital Thermometer’s product_name and price in usd. Finally, multiply the price by the currency ratio to calculate the price in the local currency.
3.products less than 26 Euros Products more than 299 Euros
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
join the Product with the Currency table where the currency name is 'Euro' to get the current ratio. After that, calculate the price in Euros. Finally, using a WHERE clause that specifies the price 4. The first subquery calculates the total number of unique store locations, then counts how many different stores sell each product. 5.
6.
7. 8. Let's consider two transactions, Transaction1 and Transaction2, which are both updating the price of the same product in the Product table. T1 reads the price of a Glucometer, intending to apply a 10% discount. T2 reads the price of a Glucometer, intending to raise the price by 5$. Name US Dollar Price Glucometer $50 Bag Valve Mask $25 Digital Thermometer $250
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
Transaction 1 Read the value from row 1. Multiply that value times 0.9. Write back the result. Commit. Transaction 2 Read the value from row 1. Add that value by 5. Write back the result Commit. 9. Example Deadlock Schedule Step Explanation Transaction 1: Read row 1 Transaction 1 now has a shared lock on row 1. Transaction 1 : Multiply that value times 0.9.. Transaction 2: Read row 1(attempt) Transaction 2 must wait at this step, because it is unable to obtain an exclusive lock on row 1, since Transaction 1 already has a shared lock on row 1. Transaction 1: Write back the result. Transaction 2: Read row 1 Transaction 2 now has a shared lock on row 1. Transaction 2: Add that value by 5 Transaction 2: Write back the result. A deadlock occurs when two or more transactions hold locks that the other transactions are trying to acquire and none of them can proceed. The database system would typically detect this situation and resolve the deadlock by aborting one of the transactions and rolling back its changes, allowing the other transaction to proceed.