Results 1 to 7 of 7
  1. #1
    Join Date
    Feb 2009
    Posts
    7

    Relation in ERD have primary key attribute?

    Can relation in Entity-Relationship diagram have an attribute which can be called as a primary key? Pardon me if it sounds silly!

  2. #2
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    Quote Originally Posted by sandyssn
    Can relation in Entity-Relationship diagram have an attribute which can be called as a primary key? Pardon me if it sounds silly!
    no it's not silly, but no, i don't think relations have PKs

    relations are FKs, ultimately

    i realize that there are some ER diagramming conventions that have rectangles for entitites and diamonds for relationships, but that's too messy for me

    the ER diagrams that i create simply have rectangles for entitites and lines connecting them for the relationships

    among other things, this means i never draw a many-to-many relationship, but always use two one-to-many relationships with a "relationship" entity defined to carry the FKs

    make sense?

    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  3. #3
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    Rudy - are you confusing relations and relationships here?
    Testimonial:
    pootle flump
    ur codings are working excelent.

  4. #4
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    Quote Originally Posted by pootle flump
    Rudy - are you confusing relations and relationships here?
    almost certainly

    what's the difference?

    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  5. #5
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    The former are foisted up on you, the latter you get to choose.

    Are you in an obtuse mood today or were you simply fishing?
    Testimonial:
    pootle flump
    ur codings are working excelent.

  6. #6
    Join Date
    Feb 2009
    Posts
    7
    got a vague picture though!

  7. #7
    Join Date
    Sep 2002
    Location
    UK
    Posts
    5,171
    In the Barker ERD notation we Oracle types use, an Entity can have a Unique Identifier defined which may consist of one or more attributes and relationships. Relationships that are part of the Unique Identifier are marked with a bar at the end next to that entity.

Posting Permissions

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