Answer to Question #156612 in Databases | SQL | Oracle | MS Access for RAFI

Question #156612

Consider two entity sets A and B that both have the attribute X (among others whose

names are not relevant to this question).

a. If the two Xs are completely unrelated, how should the design be improved?

b. If the two Xs represent the same property and it is one that applies both to A and to

B, how should the design be improved? Consider three subcases:

 X is the primary key for A but not B

 X is the primary key for both A and B

 X is not the primary key for A nor for B


1
Expert's answer
2021-01-19T15:28:19-0500

a. If the val attribute in two entites are completely unrelated, how should the design be improved?

answer : Basically it does not creating any problem When only one one person ( creator ) is managing the relations. But for easy understanding to some one else ,more preferable option is changing one of the attribute name

b. If the val attribute in two entites represent the same property and it is one that applies both to A and to B, how should the design be improved?

- val is the primary key for A but not B

answer : when "val" attribute in two entites represent the same property that applies to both to A and to B .we can use Referential integrity (foreign key ) . eg:- foreign key in B ("val") Referencing primary key in   A "val"

- val is the primary key for both A and B

answer :if val is the primary key of both A& B . it would be better to combine the table and make it as single table if the table has small number of attributes.

Usually , to seperate a table which has large number of attributes, the above methode is used (same primary key for both relation A and B )

- val is not the primary key for A nor for B

answer : if "val" is a non key in both relation A & B. there is a high chance of Data redutancy . ofcourse two tables can have same column name . But if they represent same property ,they should be connected either way and unique     eg: foreign key "val" in B refers to a non-primary unique key "val" in A


Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS