SQL locking types
SQL locks the data with different lock mode while some operations are performed upon, which prevent them by data conflict and to determine that how resources are accessed. Different types of lock are applied on the data which are:
Shared lock: applied for read operation, in which the data is not updated or changed such as SELECT statement. When shared lock applied other can read the data but canít modify it.
Update lock: it is mix of shared and exclusive lock type. It is applied on those data which can be updated. It is used to prevent from deadlock because while one user is doing updating, other users have to wait for the resource to be free.
Exclusive lock: this locking type is performing while such operations like INSERT, UPDATE or DELETE is going on.
Schema Lock: when a table dependent schema operation is performing at that time this lock type is used.