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

 

mysql的基本操作

上一篇:MySQL5.7安装


下一篇:较详细的gdb入门教程