Which SQL statement defines a FOREIGN KEY constraint on the DEPTNO column of the EMP table?

Which SQL statement defines a FOREIGN KEY constraint on the DEPTNO column of the EMP
table?

Which SQL statement defines a FOREIGN KEY constraint on the DEPTNO column of the EMP
table?

A.
CREATE TABLE EMP
(empno NUMBER(4),
ename VARCHAR2(35),
deptno NUMBER(7,2) NOT NULL,
CONSTRAINT emp_deptno_fk REFERENCES dept (deptno)
FOREIGN KEY (deptno));

B.
CREATE TABLE EMP
(empno NUMBER(4),
ename VARCHAR2(35),
deptno NUMBER(7,2) NOT NULL,
CONSTRAINT emp_deptno_fk FOREIGN KEY deptno
REFERENCES dept deptno);

C.
CREATE TABLE EMP
(empno NUMBER(4),
ename VARCHAR2(35),
deptno NUMBER(7,2) FOREIGN KEY
CONSTRAINT emp_deptno_fk REFERENCES dept (deptno));

D.
CREATE TABLE EMP
(empno NUMBER(4),
ename VARCHAR2(35),
deptno NUMBER(7,2)
CONSTRAINT emp_deptno_fk REFERENCES dept (deptno));

Explanation:

This statement provides correct syntax to define the FOREIGN KEY constraint on the DEPTNO
column of the EMP table.



Leave a Reply 0

Your email address will not be published. Required fields are marked *