Results 1 to 12 of 12

Thread: ERD help.

  1. #1
    Join Date
    Mar 2010
    Posts
    5

    ERD help.

    I have a few questions on ERD design. If anyone could help me that would be great. I'm not asking for someone to do my homework..I just need some help identifying entities and relationships.

    Thanks..

  2. #2
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    Quote Originally Posted by smudge1 View Post
    I have a few questions on ERD design.
    we're supposed to guess them?



    sometimes i crack myself up
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  3. #3
    Join Date
    Mar 2010
    Posts
    5
    Situation.
    The state of Georgia is interested in designing a database that will track it's researchers. Info includes researcher name, title, position, university name, location, enrollment, and research interests. Each researcher is associated with only one institution, and each researcher has several research interests.

    I know this has to do with cardinality..I'm just having trouble with it.

  4. #4
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    relationship cardinalities are either one-to-one, one-to-many, or many-to-many

    1. Each researcher is associated with only one institution

    this eliminates the many-to-many relationship

    it's a fair guess that an institution has more than one researcher

    that would eliminate the one-to-one relationship


    2. Each researcher has several research interests.

    this eliminates the one-to-one relationship

    which of the other two do you think it is?
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  5. #5
    Join Date
    Mar 2010
    Posts
    5
    One to many? Are my entities correct...Researcher, Institution, Interests?

  6. #6
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    Quote Originally Posted by smudge1 View Post
    One to many?
    why do you think this?


    Quote Originally Posted by smudge1 View Post
    Are my entities correct...Researcher, Institution, Interests?
    what's an institution?
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  7. #7
    Join Date
    Mar 2010
    Posts
    5
    because each instance relates to one or more instances?
    I guess i'm wrong with the entities. Researcher, interests..university?

  8. #8
    Join Date
    Jul 2009
    Location
    Michigan
    Posts
    125
    Your entities are Researcher, Interest, and University.

    For each University there can be many Researchers.
    For each Researcher there can be only one University.

    For each Researcher there can be many Interests.
    For each Interest there can be many Researchers.

    So you will need tables like:

    University - UniversityID (primary key), name, etc.
    Researcher - ResearcherID (primary key), UniversityID (foreign key to University), name, etc.
    Interest - InterestID (primary key), description, etc.
    ResearcherInterest - ResearcherID (foreign key to Researcher), InterestID (foreign key to Interest).

    The ResearcherInterest table will have a primary key composed of the ResearcherID and InterestID combined to ensure you don't have duplicates. This table will allow the many to many relationship you need between Researcher and Interest.

  9. #9
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    nice one, mark

    you just handed him a complete solution for a homework assignment

    my philosophy is, we shouldn't do the work for them, but we might guide them through the learning process

    i understand the desire to be helpful, but there should be limits...
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  10. #10
    Join Date
    Jul 2009
    Location
    Michigan
    Posts
    125
    And my philosophy is we should help people not just jerk them around.

    If you feel I have done something against the rules of the forum report me and we will let the mods sort it out.

  11. #11
    Join Date
    Jun 2007
    Location
    London
    Posts
    2,527
    Quote Originally Posted by MarkATrombley View Post
    If you feel I have done something against the rules of the forum report me and we will let the mods sort it out.
    Mark

    Your answers to users questions are always great but the question is whether we should be handing out answers to students. Obviously the idea of homework is to make the student think. If they're just stuck then yes we can, and should, clear up any difficulties for them. If they're just plain lazy then it's up to you how much you want to help but remember you're not doing them any favours in the long term.

    Mike (moderator)

  12. #12
    Join Date
    Mar 2010
    Posts
    5
    Thanks for the help. r937 had me thinking last night and got me in the right direction. This was my second ERD. The first one I did after a lot of thinking. It may be wrong but thats what I'm in school for..to learn. Again thank all of you for the help.

Posting Permissions

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