MYSQL的增删改查

2017-11-21  本文已影响0人  likeli

插入语句

insert into 表名(表的字段1,表的字段2)values(字段1的值,字段2的值);字符串类型的加上引号
例如:insert into menu(id,menuname,price,img)value(NULL,'牛肉羹','20','https://ss1.bdstatic.com/70cFvXSh_Q1YnxGkpoWK1HF6hhy/it/u=2759220099,553595254&fm=27&gp=0.jpg');

删除语句

delete from 表名 where name=luxp;
delect from student where name="luxp";

修改语句

update 表名 set 字段1=‘值’,字段2=‘值’ where 条件//update student set age=18 where name='luxp';
如:update student set name='li',age=15,where name='luxp';

查询语句

我们用的最多的而且最重要的就是查询语句

上一篇 下一篇

猜你喜欢

热点阅读