首页 > 数据库技术 > 详细

mysql的基本操作

时间:2021-01-24 21:56:09      阅读:42      评论:0      收藏:0      [点我收藏+]
use myblog;

-- show tables;

-- insert into users(username,`password`,realname) values(‘lisi‘, ‘123‘, ‘李四‘);

-- select * from users;

-- select id,username from users;

-- select * from users where username=‘zhangsan‘ and `password`=‘123‘;

-- select * from users where username<>‘zhangsan‘;

-- select * from users where username=‘zhangsan‘ or `password`=‘123‘;

-- select * from users where username like ‘%zhangsan%‘;

-- select * from users where password like ‘%1%‘ order by id desc;

-- update users set realname=‘李四2‘ where username=‘lisi‘;

-- SET SQL_SAFE_UPDATES = 0;

-- delete from users where username=‘lisi‘;

-- insert into blogs(title,content,createtime, author) values(‘标题B‘, ‘内容B‘, 1611491115270, ‘李四‘);

-- select * from blogs;

-- update blogs set author=‘lisi‘ where title=‘标题B‘;

select version();

 

mysql的基本操作

原文:https://www.cnblogs.com/chenmiaosong/p/14322221.html

踩
(0)
赞
(0)
   
举报
评论 一句话评论(0)
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!