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
What are types of indexes?
What is null indicator in db2?
What is explain in db2?
What is a db2 table?
Can we update view in db2?
What is the difference between spufi and qmf?
What is a trigger in the db2 database?
How do I delete a column in db2?
What is copy pending and check pending in db2?
What is cobol db2?
How to fetch the last row from the table in SQL (db2)?
What is table space in db2?
Can one database have multiple instances?
What's The Percentage Free Space ?
What is lock escalation in db2?