in Databases
358 views
0 votes
0 votes

in Databases
358 views

3 Comments

Relation S maintain foreign key for D on attribute A of Relation R

@Arjun Sir, @Bikram sir Doesn’t this mean that a foreign key A has been maintained for attribute D and so

A is foreign key while D is primary key

0
0
edited by

@jiminpark 

A foreign key is a set of attributes in a table that refers to the primary key of another table. The foreign key links these two tables...

In the context of relational databases, a foreign key is a set of attributes subject to a certain kind of inclusion dependency constraints, specifically a constraint that the tuples consisting of the foreign key attributes in one relation, R, must also exist in some other (not necessarily distinct) relation, S, and furthermore that those attributes must also be a candidate key in S….

In simpler words, a foreign key is a set of attributes that references a candidate key…

A) Each record of R is related to 0 or more record of S ....

1. https://gateoverflow.in/78457/Foreign-key-constraint 

2. https://stackoverflow.com/questions/18435065/foreign-key-to-non-primary-key 

3. https://gateoverflow.in/181864/Referential-integrity

0
0

@aaa 1 , My question is not “ What is foreign key

but “ Shouldn’t foreign key be D “?

I am getting this confusion because the statement says like

“ S maintain foreign key for D on attribute A of Relation R

- which should mean F.key is on attribute A and maintained for D(primary key).

Please justify the quoted statement !

0
0

1 Answer

0 votes
0 votes
Correct answer : (a)

Reason :

As relation S is maintaining foreign key for attribute D on attribute A of relation R, we can say that every value that attribute D takes will be from the set of values that attribute A has. Hence, D can have a value multiple times (0 or more times).

 

Please correct me if i’m wrong and it’s not the answer.

3 Comments

@taurus05 ,  answer is A and C

but doesn’t  “ S maintains a foreign key for D on attribute A “ means

that A is foreign key → for D ?

0
0

@jiminpark Yes if it’s MSQ then (d) can be chosen as (a) is correct. And about your doubt, here it means D is FK and A is PK to which D is referencing. I hope it helps :)

1
1

@ankit3009 Sir,  but doesn’t that statement makes this situation ambiguos.. 

means  “ foreign key FOR D “ –  can make us think that we are making some other key as foreign key so that it references to D (making foreign key on A for D)

Please read the statement in parenthesis again !

0
0