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.
Answers were Sorted based on User's Feedback
Answer / 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 |
Answer / s
CREATE TABLE QUALIFIER.TABLE
(EMP-N0 CHAR(6) NOT NULL,
MANAGER CHAR(6) NOT NULL)
IN TABLESPACE;
ALTER TABLE QUALIFIER.TABLE
FOREIGN KEY FKM (MANAGER) REFERENCES QUALIFIER.TABLE
ON DELETE CASCADE;
| Is This Answer Correct ? | 1 Yes | 1 No |
Answer / 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 |
Once you create a view, where would information about the view be stored?
How would one remove old reorg information from the DB2 catalog?
What is the maximum length of a column name in DB2? 18 or 30 or anything other than these?
What are catalog tables in db2?
What does the sqlcode of -818 pertain to?
File not opened because library is *PROD and debug is UPDPROD(*NO). ? what may be the reason? how to solve it..?
How to get Top 10 Salaries from a Table
What are leaf pages?
Hi, i would like to start a new carrier in DB2 DBA.Which and what all step should i have to take..?
What is an inner join, and an outer join ?
What is difference between rollback and commit?
What is universal database?