what is the Foreign key? explain?

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

While unloading huge amount of data from table. Suddenly job failed some error. Imagine 1M data unloading, In that 90% data unloaded only 10% left, So if want to unload the rest 10% what needs to be done? Whether do i need to start from top or anything ?

1921


What is commit in db2?

687


What is phantom read in db2?

720


How does db2 sample database connect?

655


What is table space in db2?

670






What's The Percentage Free Space ?

868


Can there be more than one cursor open for any program?

775


How do I add a column in db2?

674


What's The Error Code For Unique Index Voilation?

733


What is the difference between db2 and oracle?

761


What is the maximum length of sqlca?

982


Give the name of some fields form sqlca.

700


What is the information associated with sysibm.syslinks table?

756


What is the syntax for creating a table in the db2 database?

721


How and when does the db2 enforces the unique key?

724