what is the Foreign key? explain?
Answers were Sorted based on User's Feedback
Answer / gowrinag
FOREIGN KEY YFK (YNO) REFERENCES Y
ON DELETE CASCADE,
FOREIGN KEY ZFK (ZNO) REFERENCES Z
ON DELETE RESTRICT)
IN OZAGENDB.OZAGENTS;
ex:
CREATE TABLE YZ
(YNO CHAR(5) NOT NULL,
ZNO CHAR(5) NOT NULL,
QTYINTEGER,
PRIMARY KEY (YNO,ZNO),
FOREIGN KEY YFK (YNO) REFERENCES Y
ON DELETE CASCADE,
FOREIGN KEY ZFK (ZNO) REFERENCES Z
ON DELETE RESTRICT)
IN OZAGENDB.OZAGENTS;
---------+---------+---------+---------+---------
YNO ZNO QTY
---------+---------+---------+---------+--------
Y1 Z1 300
Y2 Z2 400
| Is This Answer Correct ? | 2 Yes | 1 No |
Answer / guest
A foreign key establishes the referential constraint
between a parent table and a dependent table
| Is This Answer Correct ? | 3 Yes | 3 No |
when we are tying to update a table having 100 rows. if the program abends when updating 51 row . how to start updating again from the 51 row .what was the logic
Can there be more than one cursor open for any program?
How do I optimize a query in db2?
Name the different types of Table spaces.
have 3 tables table1, table2 and table3 which contains employee information. table1 is master table, table2 contains emp details like emp no and so on, table 3 contains emp salary. so if any emp leave company between 25th - 30th of every month it has to get updated in tables. but it is not getting updated. What is the reason.
What is dclgen (declaration generator)?
What kind of database is db2?
What happens to a tablespace when its recovery infromation has been removed and a full recovery is no longer possible?
What is meant by the attachment facility?
How do I handle -911 (deadlock) error in a db2 program so that the program will never abend?
what is different three logs in DB2?
If I have a view which is a join of two or more tables, can this view be updatable?