7

I'm creating an ER diagram for a class assignment and I was wondering if it would be possible to create an entity that had no direct relationship to any other entity, and simply use foreign keys to connect them. The diagram below illustrates what I'd like to do

enter image description here

Basically, my diagram is starting to get really complex and it would be great if I didn't have to maintain a connection between every single entity.

FWIW, I'm using Chen and Crow's Foot notation, if that's any help.

12

An ER diagram is merely a tool to aid you in development. An ER diagram doesn't even by mandate require you to show all the entities in the system.

So to answer your question by one route: It's perfectly acceptable to have an entity on a diagram that has no relationship to any other entity. Consider a settings table that is used by a simple application to store the settings for the program. It would not need any other entities to do its job. But it would still be an object which existed within the scope of the datastore.

So to answer your question by another route: You can display as many or as few diagrams on your ER diagram as are required to show the information you're trying to represent. But if you choose to omit a relationship for purposes of clarity, it would still make sense to make a note that the R is omitted. I would personally but a -{#} with a number inside the related circles for each entity, with a footnote for that # at the bottom of the page. That way other readers won't have to ask if there should be another relation.

That's my $0.05 worth on this one anyways. The point here is that this is partly a matter of style. Some people will tell you that you always have to put the relationships (like, for instance, your boss might require that, and that would trump my advice). But the final truth is what's in the database.

  • "An ER diagram doesn't even by mandate require you to show all the entities in the system" - furthermore for complex systems it is very common not to, having an ER diagram for each sub-part rather than one that tries to cover everything. If an entity has links to entities not in the current diagram you should include a "dummy" entity or footnote, as suggested above. It is fine for the same entity to exist in multiple diagrams within the set too, if your naming convention is clear it should be obvious that this is the case where you have done it. – David Spillett Jul 12 '17 at 13:40
  • 1
    You should edit the answer to make feedback like this more explicit – jcolebrand Jul 12 '17 at 13:49
  • I wasn't entirely sure it add core benefit to the answer or should stay as a footnote - I usually let the original answerer edit the extra in if they want to in such cases. Happy to edit myself if you'd rather though. – David Spillett Jul 13 '17 at 10:16
  • 1
    Nah, go on and edit it. This is a community site, you're adding good detail. – jcolebrand Jul 13 '17 at 13:15
3

By virtue of the fact that two entities are "related" via a foreign key, there is a direct relationship between them. Whether or not you choose to diagram this relationship conventionally is up to you, however I would then refer to your notation as something like, "Chen-Wilson" or "Chris's Crow Foot", since it's no longer "pure" Chen or Crow's Foot. I agree with jcolebrand; definitely document the missing relationship connector so your instructor won't think you've made a mistake.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy