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 is dclgen (declaration generator)?

0 Answers  


What is image copy in db2?

0 Answers  


What is the physical storage length of time data type?

0 Answers  


how to identify the pseudo conversation by seeing the program

2 Answers   DELL,


db2 maintains information about the data... a.in tables. b.in a set of tables known as db2 catalog. c.in db2 database. d.none of the above.

1 Answers  






What is a synonym? How is it used?

2 Answers  


What is the difference between IN subselects and EXISTS subselect?

1 Answers   HCL, PreVator, TCS,


What is dclgen in db2?

0 Answers  


Suppose if I need to update a column, how you do that using cursor?

2 Answers   Verizon,


What is RUNSTATS?

3 Answers  


what is REORG? what is the use?

4 Answers  


what is main use of table space and index object? please its urgent

5 Answers   CA, Cap Gemini, CGI, CTS, EDS, HTC, IBM, Satyam, Syntel, TCS, Wipro,


Categories