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 |
DB2 is a A) data base/data communication system B) data base C) RDBMS D) Programming language
What is DYNSLT keyword? How do you perform selection using DYNSLT
how to execute qcmdexc in rpgle?plz write code also?
before altering a table is it necessary to lock ? if lock what is it ? how to do ? ifi want to lock a table what is that command ?
how can u nderstand the sql stmts executed successfully or not ?
What are types of indexes?
What is a composite index and how does it differ from a multiple index?
I am getting a error multiple row fetched while executing a Cobol-DB2 program.How can I solve it without using a cursor.
What is the difference between oracle and db2?
how can we find nth max salary from A table
How can you find out which query is taking lot of time to execute in cobol-db2 program ?
quary for 1> fetch last record 2> fetch in reverse order 3> fetch last 5 row 4> fetch second last record (their is no primary key) i think concept of count can be use for this in 4th