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
Can one database have multiple instances?
What is buffer pool in the db2 database?
Give the name of some fields form sqlca.
How can record locking be achieved in those DB2 versions which do not support it?
How to find schema of a table in db2?
How to rename a table in DB2 ?
What is db2 bind?
What are the benefits of using the db2 database?
What is the cobol picture clause of the db2 data types date, time, timestamp?
What is dpf in db2?
What is the difference between spufi and qmf?
What are types of indexes?
Explain about cursor stability?
What is db2 look?
Define predicate?