查询: 一:查询所有数据 select * from Info 查所有数据 select Code,Name from Info 查特定列 二:根据条件查 select * from Info where Code='p001' 一个条件查询 select * from Info where Code='p001' and Nation='n001' 多条件 并关系 查询 select * from Info where Name='胡军' or Nation='n001' 多条件 或关系 查询…
1.普通查询 select * from info; #查询所有内容 select Code,Name from Info #查询某几列 2.条件查询 select * from Info where Code='p001' #条件查询 select * from Info where Nation ='n001' and Sex= true #条件之间并的关系select * from Info where Nation = 'n001' and sex = '1' select * from…
--黑马程序员 DQL数据查询语言 数据库执行DQL语句不会对数据进行改变,而是让数据库发送结果集给客户端.查询返回的结果集是一张虚拟表. 查询关键字:SELECT 语法: SELECT 列名 FROM表名 [WHERE --> GROUP BY -->HAVING--> ORDER BY] 语法: SELECT selection_list /*要查询的列名称*/ FROM table_list /*要查询的表名称*/ WHERE condition /*行条件*/ GROUP BY…
创建数据库company create database company charset=utf8; use company; company.employee 员工id id int 姓名 emp_name varchar 性别 sex enum 年龄 age int 入职日期 hire_date date 岗位 post varchar 职位描述 post_comment varchar 薪水 salary double 办公室 office int 部门编号 depart_id int #…