数据库常用语句-增加,查询

use myblog;

-- 展示表格
-- show tables;

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

-- 查询users表格下所有内容,耗费性能
-- select * from users;

-- 查询user下某一些列
-- select id,username from users;

-- 查询条件,查询username为zhangsan 并且password为123的时候
-- select * from users where username='lisi' and `password`='123';

-- 模糊查询
-- select * from users where username like '%zhang%';

-- 排序
select * from users where `password` like '%1%' order by id desc;

-- 查询版本
select version();

原文地址:https://www.cnblogs.com/wzndkj/p/11403506.html