MySQL Join详解_PHP教程
程序员文章站
2022-05-05 19:30:18
...
还是先 Create table 吧
create table emp(
id int not null primary key,
name varchar(10)
);
create table emp_dept(
dept_id varchar(4) not null,
emp_id int not null,
emp_name varchar(10),
primary key (dept_id,emp_id));
insert into emp() values
(1,"Dennis-1"),
(2,"Dennis-2"),
(3,"Dennis-3"),
(4,"Dennis-4"),
(5,"Dennis-5"),
(6,"Dennis-6"),
(7,"Dennis-7"),
(8,"Dennis-8"),
(9,"Dennis-9"),
(10,"Dennis-10");
insert into emp_dept() values
("R&D",1,"Dennis-1"),
("DEv",2,"Dennis-2"),
("R&D",3,"Dennis-3"),
("Test",4,"Dennis-4"),
("Test",5,"Dennis-5");
create table emp(
id int not null primary key,
name varchar(10)
);
create table emp_dept(
dept_id varchar(4) not null,
emp_id int not null,
emp_name varchar(10),
primary key (dept_id,emp_id));
insert into emp() values
(1,"Dennis-1"),
(2,"Dennis-2"),
(3,"Dennis-3"),
(4,"Dennis-4"),
(5,"Dennis-5"),
(6,"Dennis-6"),
(7,"Dennis-7"),
(8,"Dennis-8"),
(9,"Dennis-9"),
(10,"Dennis-10");
insert into emp_dept() values
("R&D",1,"Dennis-1"),
("DEv",2,"Dennis-2"),
("R&D",3,"Dennis-3"),
("Test",4,"Dennis-4"),
("Test",5,"Dennis-5");
上一篇: 如何判断sql字段中存在中文字符?
下一篇: ORACLE 数据库设计 多对多关系
推荐阅读
-
Win2012 R2 IIS8.5+PHP(FastCGI)+MySQL运行环境搭建教程
-
Centos7安装PHP及Nginx的教程详解
-
Mysql 5.7.19 免安装版配置方法教程详解(64位)
-
mysql 5.7.17的最新安装教程图文详解
-
PHP5.5基于mysqli连接MySQL数据库和读取数据操作实例详解
-
CentOS安装mysql5.7 及简单配置教程详解
-
MySQL5.6.31 winx64.zip 安装配置教程详解
-
CentOS7.0下安装PHP5.6.30服务的教程详解
-
云主机搭建php+mysql运行环境教程(护卫神 PHP套件)
-
windows下安装mysql-8.0.18-winx64的教程(图文详解)