SQL基本语法
-- SELECT * FROM my_db_01.users; -- 1.查询整个表所有的数据 -- select * from users -- 2.查询具体的字段名字 -- select username,password from users -- 3.查询id是1的这个字段 查询的条件写在where后面 -- select * from users where id=1 -- 4.查询users表里username这个字段 模糊查询 Z%表示以z开头的 %Z写在后面后面表示以z结尾的 -- select * from users where username like 'Z%' -- 5.条件查询 -- select username,password from users where id>1 and status=0 -- 6.排序 desc(降序) asc(升序) -- select * from users order by id desc -- select * from users order by id asc -- 7.添加 -- insert into users(username,password,status) values('zl',111,1) -- 8.删除 -- delete from users where id=3 -- 9.修改(更新)update 表明 set 字段属性(多个字段用英文逗号隔开) where (修改的字段对应的id) 如果没有where 将修改整个表 -- update users set username='zs',password=555 where id=1 -- 10.函数count(*) -- select count(*) from users where status=0\