retagged by
2,729 views
2 votes
2 votes
A foreign key can refer to columns in another table, that are

A. Primary key only

B. Candidate key only

C. Unique column only.

D. Foreign key can refer any column
retagged by

3 Answers

5 votes
5 votes
A foreign key can refer to columns in another table, that are Primary key only.

In a foreign key reference, a link is created between two tables when the column or columns that hold the primary key value for one table are referenced by the column or columns in another table. This column becomes a foreign key in the second table.

Candidate keys also used if primary key is not present.

Best answer here is candidate key which is unique
edited by
0 votes
0 votes

I think answer is B. Candidate Key

According to wikipedia

https://en.wikipedia.org/wiki/Referential_integrity

any field in a table that is declared a foreign key can contain either a null value, or only values from a parent table's primary key or a candidate key

Since a primary key is also a candidate key of that relation, answer must be B

edited by

Related questions

1 votes
1 votes
0 answers
1
vaishali jhalani asked Jan 31, 2017
298 views
Foreign key should be a candidate key of parent table and should have unique value(including null) in referenced table.Is this statement correct??
3 votes
3 votes
2 answers
2
Hira Thakur asked Nov 3, 2016
1,485 views
What is on delete no action,on delete cascade, on delete set null action??explain through some eg??
1 votes
1 votes
1 answer
4
rishu_darkshadow asked Sep 28, 2017
5,242 views
Explain recursive foreign key with suitable example..