mysql的基本操作

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();

 

posted @ 2021-01-24 20:44  松歌  阅读(62)  评论(0编辑  收藏  举报