Results 1 to 7 of 7
  1. #1
    Join Date
    Apr 2009
    Posts
    4

    A Quick Question About ER Mapping

    Hey

    I'm just looking for some help on mapping a certain relationship for a simple DB I'm working on.

    My problem is that I have one entity that has to have a relationship with one of two other entities. It must be one and cannot be both. And for the life of me I can't figure out how to map this relationship effectively.

    example
    I have the entities Class, Professor and Tutor. A Class must be taught by either a Professor or a Tutor. But cannot be taught by both.

    A Professor or Tutor may not teach any classes at all or may teach more than one.

    Any ideas? Thanks in advance for the help

  2. #2
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    So to back up a bit, any good reason why you consider Professor and Tutor as two distinct entities, rather than a single entity with a non-key attribute to indicate whether they are a Professor or a Tutor?
    Testimonial:
    pootle flump
    ur codings are working excelent.

  3. #3
    Join Date
    Apr 2009
    Posts
    4
    That's just the example Sorry, it's for an assignment so I thought I wouldn't ask with the specific entities/relationships.

    But in my DB they are quite seperate entities (A company and an Individual) and can't be merged. Sorry for the confusion.

  4. #4
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    There are other ways of skinning that cat.

    Have you heard of sub type and supertype?
    Testimonial:
    pootle flump
    ur codings are working excelent.

  5. #5
    Join Date
    Apr 2009
    Posts
    4
    Yeah, I'm using sub types elsewhere in my design, but I don't think I can use it here.

    My specific situation is that I have a product entity that has to have an owner, either a company, or a individual. Companies and Individuals have no common attributes so I can't specialise them from one entity. And they are both used in other relationships (example there is also a Manufactures relationship between product and company).

    I'm guessing there isn't a simple way to do what I asked and have an or relationship?

  6. #6
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    Have a read of this then - your problem and a solution are buried in there - have a dig
    http://www.dbforums.com/database-con...-resolved.html
    Testimonial:
    pootle flump
    ur codings are working excelent.

  7. #7
    Join Date
    Apr 2009
    Posts
    4
    yep that looks similar alright, thanks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •