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 |
what is a plan and how do you refer the plan in the program?
Why select is not preferred in embedded sql programs?
how can u retrieve the data from null values using applicaion program.
what is consistency token
What is copy book?
Is there any advantage to denormalizing DB2 tables?
What is clone table?
Are view updateable?
In a single table,How to retrieve a employee-id of an employee who works in more than one department?
Why might full image copies be faster to implement than an incremental image copy?
I have 1000 rows in a db2 table.I want to update first 100 records,How do I do it?
What do you mean by commit and rollback?