Question

1- Explain, as best you can, why the primary key of the "one" side becomes the...

1- Explain, as best you can, why the primary key of the "one" side becomes the foreign key on the "many" side in a 1:M relationship?

0 0
Add a comment Improve this question Transcribed image text
Answer #1

primary key: A primary key is a combination of attributes which uniquely identifies an Instance of Entity uniquely.

Foreign key: A Foreign key is mainly used to represent the relationship between an attribute from one entity to the other entity.

Foreign key & primary key concept is widely used in one-one and one-many Relationships.

Let us see clearly with an example.

Take two entities as follows:

Entity 1: Bank Entity2: House

Bank
pk: LoanId
BankName
Location
House
Fk:FundLoanId
HouseName
OwnerName

Here in the above two entities have the common attribute called LoanId.

pk means primary key and Fk means Foreign key.

Here there is a one-many relationship exists between Bank and House. i.e.. A single bank can give the loans to construct many houses. It is important to the bank to keep track of its debtors who took a loan from the bank for constructing the house. To do this the bank must identify the house uniquely and this is possible using LoanId as Primary key in Bank Entity and FundLoanId as a foreign key in House Entity.

Here, * indicates many.

Note: we cannot insert an instance in House Entity whose foreign key does not match with any of the primary keys in Bank entity. To be specific, we cannot insert an instance in House entity with LoanId which is not present in Bank Entity. If we try to do so we will get an error.

The key point in one-many relationship among entities with respect to primary and foreign keys is that all the foreign keys in one must be a part of primary keys in other entity. This is also known as Referential integrity.

Add a comment
Know the answer?
Add Answer to:
1- Explain, as best you can, why the primary key of the "one" side becomes the...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT