No, above commands will not be able to achieve desired task as update and alter commands have been interchanged.
In order to achieve desired result, following corrections should be incorporated in the previously used commands:
(i) To add a new column “Rating”:
Alter table library add column rating varchar(20);
(ii) To give an increase of 50 Rs. to all the books:
Update library set price=price+50;