一对多的关系
#添加一端的主键约
mysql> alter table dept add primary key(deptno) ;
Query OK, 0 rows affected (0.18 sec)
Records: 0 Duplicates: 0 Warnings: 0
#添加多端的逐渐啊约束
mysql> alter table emp add primary key(empno) ;
Query OK, 0 rows affected (0.16 sec)
Records: 0 Duplicates: 0 Warnings: 0
#添加多端的外键约束
mysql> alter table emp add constraint fk_emp_dept foreign key(deptno) references dept(deptno) ;
Query OK, 14 rows affected (0.15 sec)
Records: 14 Duplicates: 0 Warnings: 0
#都添加成功了 这两个表格就产生了一对多的关系
#接下来就可以 做联合查询的事
mysql> desc emp ;
+----------+-------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+----------+-------------+------+-----+---------+-------+
| empno | int(5) | NO | PRI | NULL | |
| ename | varchar(10) | YES | | NULL | |
| job | varchar(</