0

I am designing a database of a school management system. I have one to one relationship of MyTable with ContactInfo table. I am confused whether I separate contactinfo from MyTable or not. ContactInfo record will be single against each MyTable record, but ContactInfo can be updated many times.

Should i merge ContactInfo as
Merged two tables

or develop a separate ContactInfo as given below enter image description here

Please justified your help with the solid arguments or rule. Thanks for your help. Note: ignore the blur fields.

4
  • Why the hell would you separate those ? If all properties belong to the same entity, it goes to 1 table. You could justify 1 to 1 either when you have different entities, or -evntually - when a field group is rarely used.
    – iDevlop
    Commented Nov 9, 2015 at 13:33
  • I was just confused with respect to clarity. I think, we should separate a sub-entity separately in a table. To make a database design more understandable and clear. Commented Nov 9, 2015 at 13:37
  • @MUHAMMADTASADDUQALI try to be more clear about what you are really asking.
    – jkavalik
    Commented Nov 9, 2015 at 13:41
  • Ok @jkavalik. I will try this. Commented Nov 9, 2015 at 13:50

1 Answer 1

1

I do not know exactly what you mean by 'updated many times' but I presume that you mean that the same ContactInfo can be present in multiple MyTable entries. In this case I would split it but put the ContactId in the MyTable entity. This way you are sure that all ContactInfo is the same everywhere it is used in MyTable.

The rule is that you put all fields that are identified by a single primary key in a separate entity. This way you minimize the number of updates when one of the fields that 'belong' to this primary key changes.

If 1 ContactInfo entry has only 1 MyTable entry and 1 MyTable entry has only 1 ContactInfo entry then the separation is not necessary. The only advantages are:

  • If the length of an entry is big there is less chance that an entry does not fit in the physical block any more and needs to be 'moved' to an other physical block by the RDBMS.
  • When you rarely need to select the ContactInfo and MyTable at the same time that (with a lot of rows) the fetch in of the rows goes faster since more entries will fit in a physical block.
1
  • thanks, @Marco. I will use ContactId in Mytable. Contactinfo may be added later for a MyTable record. Commented Nov 9, 2015 at 13:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.