Imagine you open a social media app and see your list of friends. How does the app use a database to get this list?
Think about how the app knows which friends belong to you.
The app queries the database using your user ID to find friends linked to you. This is how it gets the correct friend list.
Follow the steps below and choose what happens right after the app checks your balance:
1. You enter amount to send.
2. App checks your balance.
3. ???
Think about what must happen after confirming you have enough money.
After confirming your balance is enough, the app updates both your and the receiver's balances in the database to reflect the transfer.
Which statement best describes a key difference in how social media and banking apps use databases?
Think about what each app needs most from its database.
Social media apps need to quickly access many user connections, while banking apps require secure and accurate transaction records.
What database operation happens when you click 'like' on a post?
Think about what changes in the database when you like something.
Clicking 'like' updates the post's record in the database to include your user ID in the list of likes, increasing the like count.
During a money transfer, the app loses connection to the database after deducting money from your account but before adding it to the receiver's account. What is the likely result?
Think about what happens if only part of a transaction is saved.
If the database connection is lost mid-transfer, only part of the transaction may be saved, causing money to be deducted from your account but not added to the receiver's, leading to errors.