what is the Foreign key? explain?

Answers were Sorted based on User's Feedback



what is the Foreign key? explain? ..

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

what is the Foreign key? explain? ..

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

Post New Answer

More DB2 Interview Questions

What does db2 blu stand for?

0 Answers  


What if we try to insert the base table through updatable view , but failed to give a column value which is defined as NOT NULL.

1 Answers   Cap Gemini,


Write a query to retrive partial string.

2 Answers  


What is a LIKE table and how is it created?

2 Answers  


What is the clustering index in the db2 database?

0 Answers  






What are the different methods of accessing db2 from tso? How is the connection established between TSO & DB2?

3 Answers   Tech Mahindra,


What are the uses of db2 optimizer?

0 Answers  


pls explain the precompilation process of cobol-db2 pgm

3 Answers   HCL, IBM,


What is db2 bind process?

0 Answers  


What is null in db2?

0 Answers  


How do I connect my db2 database to ibm?

0 Answers  


Hello All, We have requirment to Replace BMC Db2 Load product thru CA FAST LOADPlus product. Do anyone have JCL to for FAST LOADPLUS and what all are thing need to take in consideration.

0 Answers   IBM,


Categories