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

Can we insert update delete in view?

659


What is netezza database?

664


List out the three types of page locks that can be held.

789


Hi, i would like to start a new carrier in DB2 DBA.Which and what all step should i have to take..?

2782


What is bind plan?

701






What is db2 bind process?

829


What is a db2 table?

684


How do I delete a column in db2?

755


Which isolation level provides highest data integrity?

675


How can we read records for specific member in CL? AND rpg?

322


How do I delete a table in database?

689


What are the prerogatives?

701


What is db2 purescale?

644


What is the difference between drop table and delete table?

653


What is explain in db2?

655