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 |
How do you stop a db2 database in linux?
What can the SET option of the Repair Utility accomplish?
What is check constraint in db2?
What techniques will be used to avoid deadlock??
Can a primary key have null values? If we try to insert a null value in a primary key column, will it work or give an error code?
How do run the JCL which has 25 steps by skipping the following steps 5, 10,15 and 25 without using COND statement
What is the difference between static and dynamic SQL?
What is pagespace?
How connect db2 database to datastage?
What is a predicate?
What is DYNSLT keyword? How do you perform selection using DYNSLT
What is db2? Explain.