Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. How Can We Avoid Creatng Closed Pathes in our Design

How Can We Avoid Creatng Closed Pathes in our Design

Scheduled Pinned Locked Moved Database
designhelpquestionannouncement
6 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Y Offline
    Y Offline
    yousefshokati
    wrote on last edited by
    #1

    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

    C S L 3 Replies Last reply
    0
    • Y yousefshokati

      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

      C Offline
      C Offline
      Chris Meech
      wrote on last edited by
      #2

      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]

      1 Reply Last reply
      0
      • Y yousefshokati

        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

        S Offline
        S Offline
        SilimSayo
        wrote on last edited by
        #3

        Can you describe in some detail what Media and Articles are and how they relate to each other? Can you also describe what the Groups entity is about?

        1 Reply Last reply
        0
        • Y yousefshokati

          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

          L Offline
          L Offline
          Lost User
          wrote on last edited by
          #4

          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:

          Y 1 Reply Last reply
          0
          • L Lost User

            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:

            Y Offline
            Y Offline
            yousefshokati
            wrote on last edited by
            #5

            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?

            L 1 Reply Last reply
            0
            • Y yousefshokati

              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?

              L Offline
              L Offline
              Lost User
              wrote on last edited by
              #6

              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:

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups