How do I create a table MANAGER (EMP-NO, MANAGER) where
MANAGER is a foreign key which references to EMP-NO in the
same table? Give the exact DDL.

Answer Posted / sahil garg

CREATE TABLE TB_MANAGER
(EMPNO CHAR(6) PRIMARY KEY ,
MANAGER CHAR(6) );


ALTER TABLE TB_MANAGER
ADD CONSTRAINT TB_FK FOREIGN KEY (MANAGER) REFERENCES
TB_MANAGER(EMPNO);

Is This Answer Correct ?    2 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Give the name of some fields form sqlca.

609


What is runstats utility in db2?

569


What is a db2 package?

597


What is db2? Explain.

601


Is ibm db2 open source?

584






What is the difference between drop table and delete table?

550


Are view updateable?

627


What is catalog database in db2?

640


What is db2 connect?

603


Are views updateable?

641


What is the physical storage length of time data type?

673


Explain in detail about buffer manager and its functionalities?

559


what is db2 restart?

1689


Is db2 a programming language?

602


What is explain plan in db2?

587