我有两个名为 EMPLOYEE 和 DEPARTMENT 的表,如下所示:
CREATE table "EMPLOYEE" (
"EMP_ID" NUMBER,
"ENAME" VARCHAR2(4000),
"SALARY" VARCHAR2(4000),
"COMPANY" VARCHAR2(4000),
"CONTACTNO." NUMBER,
"GENDER" CHAR(100),
constraint "EMPLOYEE_PK" primary key ("EMP_ID")
)
CREATE TABLE "DEPARTMENT"
(
"DEPT_ID" NUMBER,
"DEPT_NAME" VARCHAR2(4000),
"LOCATION" VARCHAR2(4000),
"CONTACTNO." NUMBER,
CONSTRAINT "DEPARTMENT_PK" PRIMARY KEY ("DEPT_ID") ENABLE
)
现在我正在尝试将 EMPLOYEE 表的 Emp_ID 作为 EMPLOYEE 表本身的主键,但它应该作为 DEPARTMENT 表中 DEPT_ID 的外键,请告知如何实现这一点!