(七)MySQL数据操作DQL:多表查询2】的更多相关文章

(1)单表查询 1)环境准备 mysql> CREATE TABLE company.employee5( id int primary key AUTO_INCREMENT not null, name varchar(30) not null, sex enum('male','female') default 'male' not null, hire_date date not null, post varchar(50) not null, job_description varcha…
(1)准备环境 1)创建员工表 mysql> create table company.employee6( -> emp_id int auto_increment primary key not null, -> emp_name varchar(10), -> age int, -> dept_id int); mysql> insert into employee6(emp_name,age,dept_id) values -> ('tom',19,200…
mysql第四篇:数据操作之多表查询 一.多表联合查询 #创建部门 CREATE TABLE IF NOT EXISTS dept ( did int not null auto_increment PRIMARY KEY, dname VARCHAR() not null COMMENT '部门名称' )ENGINE=INNODB DEFAULT charset utf8; #添加部门数据 INSERT INTO `dept` VALUES (', '教学部'); INSERT INTO `d…
单表查询 一.简单查询 -- 创建表 DROP TABLE IF EXISTS `person`; CREATE TABLE `person` ( `id` ) NOT NULL AUTO_INCREMENT, `name` varchar() NOT NULL, `age` tinyint() DEFAULT ', `sex` enum('男','女','人妖') NOT NULL DEFAULT '人妖', `salary` ,) NOT NULL DEFAULT '250.00', `hi…
一. 综述    查询操作主要从两个方面来说:单表查询和多表查询. 多表查询包括:笛卡尔积.外键约束.内连接查询.外链接查询.自连接查询. 二 . 案例设计   1.  设计产品表(product).包括:主键id.产品名称(productName).分类编号(dir_id).零售价(salePrice).供应商(supplier).品牌(brand).折扣(cutoff).成本价(costPrice). 设计产品产品编号表( productdir). 包括:主键id.编号名称( dirName…
一. 综述   查询操作主要从两个方面来说:单表查询和多表查询. 单表查询包括:简单查询.过滤查询.结果排序.分页查询.聚集函数. 二 . 案例设计   1. 设计产品表(product).包括:主键id.产品名称(productName).分类编号(dir_id).零售价(salePrice).供应商(supplier).品牌(brand).折扣(cutoff).成本价(costPrice). 对应的SQL语句: CREATE TABLE `product` ( `id` ) NOT NULL…
mysql 数据操作 单表查询 mysql 数据操作 单表查询 简单查询 避免重复DISTINCT mysql 数据操作 单表查询 通过四则运算查询 mysql 数据操作 单表查询 concat()函数 定义显示格式 mysql 数据操作 单表查询 练习 mysql 数据操作 单表查询 concat_ws() 定义显示格式 mysql 数据操作 单表查询 where 约束 mysql 数据操作 单表查询 group by 分组 mysql 数据操作 单表查询 having 过滤 mysql 数据…
mysql 数据操作 多表查询 准备 多表连接查询介绍 mysql 数据操作 多表查询 多表连接查询 笛卡尔积 mysql 数据操作 多表查询 多表连接查询 内连接 mysql 数据操作 多表查询 多表连接查询 外链接之左连接 右连接 mysql 数据操作 多表查询 多表连接查询 全外连接 子查询介绍 mysql 数据操作 多表查询 子查询 介绍 mysql 数据操作 多表查询 子查询 带IN关键字的子查询 mysql 数据操作 多表查询 子查询 带比较运算符的子查询 mysql 数据操作 多表…
mysql 数据操作 单表查询 where约束 between and or mysql 数据操作 单表查询 where约束 is null in mysql 数据操作 单表查询 where约束 like 模糊匹配 mysql 数据操作 单表查询 where约束 工作模式 mysql 数据操作 单表查询 where约束 练习…
mysql 数据操作 单表查询 group by 介绍 mysql 数据操作 单表查询 group by 聚合函数 mysql 数据操作 单表查询 group by 聚合函数 没有group by情况下 mysql 数据操作 单表查询 group by group_concat() 函数 mysql 数据操作 单表查询 group by 注意 mysql 数据操作 单表查询 group by 练习…