一 单表查询,以下是表内容 一 having 过滤 1.1 having和where select * from emp where id > 15; 解析过程;from > where 找到数据 > 分组(没有默认一个组)> select 打印 where是出结果之前 select * from emp having id > 15; 解析过程;from > where 找到数据(没有约束条件,就是整个表)) > 分组(没有默认一个组)> select 打…
create table dep( id int primary key auto_increment, name varchar(16), work varchar(16) ); create table emp( id int primary key auto_increment, name varchar(16), salary float, dep_id int ); insert into dep values(1, '市场部', '销售'), (2, '教学部', '授课'), (3…
# 关键字exists(了解) 只返回布尔值 True False 返回True的时候外层查询语句执行 返回False的时候外层查询语句不再执行 select * from emp where exists (select id from dep where id>3); select * from emp where exists (select id from dep where id>300); 今日内容概要 navicat可视化界面操作数据 数据库查询题目讲解(多表操作) python…