If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > General > Database Concepts & Design > Relation in ERD have primary key attribute?

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 04-08-09, 06:02
sandyssn sandyssn is offline
Registered User
 
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!
Reply With Quote
  #2 (permalink)  
Old 04-08-09, 06:11
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,524
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?

__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
  #3 (permalink)  
Old 04-08-09, 06:40
pootle flump pootle flump is offline
King of Understatement
 
Join Date: Feb 2004
Location: One Flump in One Place
Posts: 14,905
Rudy - are you confusing relations and relationships here?
__________________
Testimonial:
Quote:
pootle flump
ur codings are working excelent.
Reply With Quote
  #4 (permalink)  
Old 04-08-09, 06:58
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,524
Quote:
Originally Posted by pootle flump
Rudy - are you confusing relations and relationships here?
almost certainly

what's the difference?

__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
  #5 (permalink)  
Old 04-08-09, 07:09
pootle flump pootle flump is offline
King of Understatement
 
Join Date: Feb 2004
Location: One Flump in One Place
Posts: 14,905
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:
Quote:
pootle flump
ur codings are working excelent.
Reply With Quote
  #6 (permalink)  
Old 04-08-09, 08:10
sandyssn sandyssn is offline
Registered User
 
Join Date: Feb 2009
Posts: 7
got a vague picture though!
Reply With Quote
  #7 (permalink)  
Old 04-08-09, 08:23
andrewst andrewst is offline
Moderator.
 
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.
__________________
Tony Andrews
http://tinyurl.com/tonyandrews
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On