How Can We Avoid Creatng Closed Pathes in our Design
-
Hi . I have three entities that are related to each other . So these entities have relationships with each other but the problem here is that their relationships finally make a closed path . Would you please tell me what should i do in situations like this ? I do not know even this is about normalization or not? Entities :
Media ( MediaID , MediaName , ...,GroupID)
Articles (ArticleID , Title,... ,GroupID)
Groups (GroupID , GroupName ,... )Article_Media ( MediaID, ArticleID, ...)
thanks Give me the solution because in update we can not update the records
-
Hi . I have three entities that are related to each other . So these entities have relationships with each other but the problem here is that their relationships finally make a closed path . Would you please tell me what should i do in situations like this ? I do not know even this is about normalization or not? Entities :
Media ( MediaID , MediaName , ...,GroupID)
Articles (ArticleID , Title,... ,GroupID)
Groups (GroupID , GroupName ,... )Article_Media ( MediaID, ArticleID, ...)
thanks Give me the solution because in update we can not update the records
The only thing about an update that I can see failing whould be if you are updating one of the ID columns. Assuming that these are keys of some sort, you shouldn't be doing that anyway. If you can provide more information about what fails, that would be useful. Thanks. :)
Chris Meech I am Canadian. [heard in a local bar] In theory there is no difference between theory and practice. In practice there is. [Yogi Berra] posting about Crystal Reports here is like discussing gay marriage on a catholic church’s website.[Nishant Sivakumar]
-
Hi . I have three entities that are related to each other . So these entities have relationships with each other but the problem here is that their relationships finally make a closed path . Would you please tell me what should i do in situations like this ? I do not know even this is about normalization or not? Entities :
Media ( MediaID , MediaName , ...,GroupID)
Articles (ArticleID , Title,... ,GroupID)
Groups (GroupID , GroupName ,... )Article_Media ( MediaID, ArticleID, ...)
thanks Give me the solution because in update we can not update the records
-
Hi . I have three entities that are related to each other . So these entities have relationships with each other but the problem here is that their relationships finally make a closed path . Would you please tell me what should i do in situations like this ? I do not know even this is about normalization or not? Entities :
Media ( MediaID , MediaName , ...,GroupID)
Articles (ArticleID , Title,... ,GroupID)
Groups (GroupID , GroupName ,... )Article_Media ( MediaID, ArticleID, ...)
thanks Give me the solution because in update we can not update the records
You need a group before you can create Media, Articles or a.. group? I hope that GroupID is nullable? That's the only circular reference, the one in Groups. If the GroupID is nullable, you create one, then Media and Articles.
yousefshokati wrote:
I do not know even this is about normalization or not?
It is. Those rules make you think about your design and gives you a neat way of getting some relevant structure in there. As it's now, it's merely a collection of field-names.
yousefshokati wrote:
Give me the solution
The solution is easy, you need to rethink your design. About what each entity and each attribute are going to represent, and how they relate. Normalization is about getting that structure. Good luck.
Bastard Programmer from Hell :suss:
-
You need a group before you can create Media, Articles or a.. group? I hope that GroupID is nullable? That's the only circular reference, the one in Groups. If the GroupID is nullable, you create one, then Media and Articles.
yousefshokati wrote:
I do not know even this is about normalization or not?
It is. Those rules make you think about your design and gives you a neat way of getting some relevant structure in there. As it's now, it's merely a collection of field-names.
yousefshokati wrote:
Give me the solution
The solution is easy, you need to rethink your design. About what each entity and each attribute are going to represent, and how they relate. Normalization is about getting that structure. Good luck.
Bastard Programmer from Hell :suss:
Hi And tanks for your answer . You say that When we design our database , we should design in a way that we do not have any closed path ? Am I right? But if we have 2 different relationship between 2 entities , then what should we do . Consider the following example : We have MembersTable Which represents the members of teams and we have TeamsTable That represents the Team Entity Now We have to relations between these 2 . The First relation is "Plays For" which means that "Member Plays for team A for example " and the second is "Captain Of" which stands for "Members x is captain of team A" . Now if we update one of these FK s that are in tables for creating the relationships then we will get an error , won't be?
-
Hi And tanks for your answer . You say that When we design our database , we should design in a way that we do not have any closed path ? Am I right? But if we have 2 different relationship between 2 entities , then what should we do . Consider the following example : We have MembersTable Which represents the members of teams and we have TeamsTable That represents the Team Entity Now We have to relations between these 2 . The First relation is "Plays For" which means that "Member Plays for team A for example " and the second is "Captain Of" which stands for "Members x is captain of team A" . Now if we update one of these FK s that are in tables for creating the relationships then we will get an error , won't be?
yousefshokati wrote:
Hi And tanks for your answer
You're welcome :)
yousefshokati wrote:
You say that When we design our database , we should design in a way that we do not have any closed path ?
Am I right?I'm saying that you should normalize the design; that will eliminate all weird stuff from the design and give you something you can work with. I know that it's a bit of an investment in terms of time, but it repays itself rather quickly.
yousefshokati wrote:
We have MembersTable Which represents the members of teams and we have TeamsTable That represents the Team Entity Now We have to relations between these 2 . The First relation is "Plays For" which means that "Member Plays for team A for example " and the second is "Captain Of" which stands for "Members x is captain of team A" . Now if we update one of these FK s that are in tables for creating the relationships then we will get an error , won't be?
Yes, you will. Normalization would state that you don't need the second entity. MembersTable MemberId MemberName IsCaptain Best wishes for the year to come :)
Bastard Programmer from Hell :suss: