修改、更新、删除mysql

有关于mysql的几个常用的指令

1.修改表中的值

update指令

update teacher set age=34 where name like '%zhanglingling%';

这是一条更新语句,意思就是在teacher表格中,将name相匹配为zhanglingliang的对象将年龄设置为34.当然在设置中仍然可以其他雷类似的值用相同的方法设置,修改表中元素的值。


2.删除某个元素

delete from teacher where name='zhanglingling';

将teacher表格中将姓名为zhanglingling的对象删除


3.删除表格,数据库

删除表格

drop table teacher;

删除数据库

drop database db;
4.查询特定的数据使用where特别方便。

猜你喜欢

转载自blog.csdn.net/laoyao_legend/article/details/80695064