更新数据语法
语法:
update 表名 set 字段1名字 = 字段1的值,字段2名字=字段2的值 ( where 条件 )
更新所有数据
#(1)将所有人的成绩设为100
update tb_user set score = 100;
根据条件更新
#(2)将学号时6的学生 成绩设为59
update tb_user set score = 59 where id = 6;
#(3)将名字为ww的学生,成绩为60
update tb_user set score = 60 where name='ww';
更新多个字段
#(4)将学号时5的学生 成绩设为99 名字为;'xl';
update tb_userset score =99,name = 'xl' where id = 5;
#(5)将所有人的成绩减去10分
update tb_user set score = score*0.7;
update tb_user set score = score-10;