table lock: lock table <table_name > exclusive;
row lock: select <column_name(s)> for update ....;
deadlock : Have to be very bad developer.