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 |
i want to know how the commit option works,how it save the changes? it will update the database or what ? where we can see these saved changes?
What is the connection string to connect to the DB2 Database ?
what is the role of the cursor in db2?
What is COPY PENDING status?
What is the maximum length of sqlca?
What does the REORG Utility do?
What kind of database is db2?
In an sql table that is embedded, what is the procedure to retrieve rows that are part of a db2 table?
Can you Average the Characters ?
What action db2 takes when a program aborts in the middle of a transaction?
What is cursor?
What is RUNSTATS?