Multiple choice technology web technology

When is a lock in database used?

  1. When you want to protect the data from outside attacks

  2. When there are users accessing the same data simultaneously

  3. When there is a chance for database to go down

  4. When database maintenance is going on

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

Database locks are used to manage concurrent access and maintain data integrity when multiple users try to access the same data simultaneously. Locks prevent conflicts like lost updates or inconsistent reads by serializing access to shared resources. They're not meant for security (protecting from attacks) or system maintenance.