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 / shankar v

Above one is true but a small correction is needed as below:

CREATE TABLE TB_MANAGER
(EMP-N0 CHAR(6) PRIMARY KEY NOT NULL,
MANAGER CHAR(6) NOT NULL)
IN TABLESPACE;

ALTER TABLE MANAGER
FOREIGN KEY (MANAGER) REFERENCES TB_MANAGER(EMP_NO)
ON DELETE CASCADE;

Is This Answer Correct ?    3 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the advantage in De-normalizing tables in DB2?

743


What is the difference between bind and rebind in db2?

848


How to create db2 table in mainframe?

629


Can one database have multiple instances?

579


In an sql table that is embedded, what is the procedure to retrieve rows that are part of a db2 table?

639






What is the information associated with sysibm.syslinks table?

657


Is db2 a database?

572


What is with ur in db2?

753


What is the use of db2?

586


How to find the maximum value in a column in the db2 database?

605


What is db2 and what is the use of db2 optimizer?

648


What is buffer pool and list some of them?

628


What is catalog database in db2?

640


List down the types of triggers in the db2 database?

588


what is the sqlcode -501

11288