两张表的建表语句:
CREATE TABLE hy_emp ( empno NUMBER(8,0) not null primary key, ename NVARCHAR2(60) not null, deptno NUMBER(8,0) not null, sal NUMBER(10,0) DEFAULT 0 not null ) CREATE TABLE hy_dept ( deptno NUMBER(8,0) not null primary key, dname NVARCHAR2(60) not null )
插值语句:
insert into hy_dept(deptno,dname) values('1','Hr'); insert into hy_dept(deptno,dname) values('2','Dev'); insert into hy_dept(deptno,dname) values('3','Qa'); insert into hy_dept(deptno,dname) values('4','Sales'); insert into hy_dept(deptno,dname) values('5','Mng'); insert into hy_emp(empno,ename,deptno,sal) values('1','Andy','1',1000); insert into hy_emp(empno,ename,deptno,sal) values('2','Bill','2',2000); insert into hy_emp(empno,ename,deptno,sal) values('3','Cindy','3',3000); insert into hy_emp(empno,ename,deptno,sal) values('4','Douglas','4',4000); insert into hy_emp(empno,ename,deptno,sal) values('5','Edinburg','5',5000); insert into hy_emp(empno,ename,deptno,sal) values('6','Felix','1',6000); insert into hy_emp(empno,ename,deptno,sal) values('7','Hellen','2',7000); insert into hy_emp(empno,ename,deptno,sal) values('8','Isis','3',8000); insert into hy_emp(empno,ename,deptno,sal) values('9','Jean','4',9000); insert into hy_emp(empno,ename,deptno,sal) values('10','King','5',10000); insert into hy_emp(empno,ename,deptno,sal) values('11','Mac','1',11000);
单表的Explain plan还好,两张表的实在让人莫名其妙:
留待日后分辨吧。