Sometimes it is require to set database as single user for maintenance or other recovery purpose.
We need to write following statement
ALTER DATABASE FriendsDB
WITH ROLLBACK IMMEDIATE;
Here ROLLBACK IMMEDIATE means if any transaction going on by other user then Rollback that data.
See below snap for more detail