更新数据
update 表名 set 字段名称=值 [where 条件];
示例:
#注意点:如果在更新数据的时候没有指定条件,那么就会更新整张表中的数据
update stu set score=77;
#注意点:如果在更新数据的时候指定了条件,那么只会更新满足条件的数据
update stu set score=88 where name='ls';
#注意点:在指定条件的时候,我们可以通过AND来指定多个条件,AND===&&
update stu set score=100 where name='lnj' and id=5;
#注意点:在字段条件的时候,我们可以通过OR来指定多个条件,OR===||
update stu set score=66 where name ='zs' OR name='ww';
#注意点:在更新数据的时候是可以同时更新多个字段的
update stu set name='it666',score=99 where id=5;