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

How to create backup table in db2?

740


Explain about open switch business continuity software?

667


have 3 tables table1, table2 and table3 which contains employee information. table1 is master table, table2 contains emp details like emp no and so on, table 3 contains emp salary. so if any emp leave company between 25th - 30th of every month it has to get updated in tables. but it is not getting updated. What is the reason.

1359


Explain in brief how does db2 determine what lock-size to use?

674


what is diffrence b/w file-aid tool and file-aid utility???

4331






What is db2 instance?

686


Explain the benefits you can get from mainframe connect?

614


What is query_cache_limit?

628


What do you mean by commit and rollback?

680


B37 abend during spufi?

1086


Mention the downsides of page level lock.

812


Why db2 is called db2?

670


What is collection in db2 bind?

664


What is the function of logging in the db2 database?

730


What is table space in db2?

668