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 is the advantage in De-normalizing tables in DB2?
What is the difference between bind and rebind in db2?
How to create db2 table in mainframe?
Can one database have multiple instances?
In an sql table that is embedded, what is the procedure to retrieve rows that are part of a db2 table?
What is the information associated with sysibm.syslinks table?
Is db2 a database?
What is with ur in db2?
What is the use of db2?
How to find the maximum value in a column in the db2 database?
What is db2 and what is the use of db2 optimizer?
What is buffer pool and list some of them?
What is catalog database in db2?
List down the types of triggers in the db2 database?
what is the sqlcode -501