Thursday, April 14, 2016

Sql update


Update sql query use for change  exiting data from the table. You  need to use where clause for update otherwise it will update whole rows of the table .You can use AND or OR operator.


Assume you wish update a student admission fee who got “A” in exam .They have to pay less then the other students.


SQL UPDATE  Example:

 update students
 set  admissionFee = admissionFee -100
 where Grade = 'A';

If you want to change multiple column values . Update query will be:

 update students
 set  admissionFee = admissionFee -100,category =1
 where Grade = 'A';




No comments:

Post a Comment