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 > what sort of key is this on a data model? very basic question!

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-05-04, 14:57
simple_simon simple_simon is offline
Registered User
 
Join Date: Dec 2003
Posts: 16
what sort of key is this on a data model? very basic question!

Hi, hopefully someone can help me with this. I'm currently working on a data model for a database-design assignment for university. I have to label up my model accurately including all the labels and keys, ie using boxes to represent tables and lines between showing relationships and their cardinality.

1. I have unique columns for each of my tables called Primary Keys,

2. I have columns from other tables called Foreign Keys,

3. But I also have a column which is the Primary Key of a particular table, but it is from another table and so is Foreign... Can anyone tell me the name of this key? and how are they usually marked up or flagged as being both on a model?
Reply With Quote
  #2 (permalink)  
Old 01-05-04, 15:14
certus certus is offline
Registered User
 
Join Date: Dec 2003
Location: Canada
Posts: 710
You can have a key that is both primary and foreign

(PK) Primary Key

(FK) Foreign Key

(PK, FK) Primary Key and Foreign Key.

Sometimes called a Foreign Primary Key.

That should do it.
__________________
visit: relationary

Last edited by certus; 01-05-04 at 15:18.
Reply With Quote
  #3 (permalink)  
Old 01-05-04, 15:17
simple_simon simple_simon is offline
Registered User
 
Join Date: Dec 2003
Posts: 16
thanks for your quick response,

so there is no unique name for a key which is both primary and foreign??!

I wasn't sure if it was called composite or compound but think that is something else.
Reply With Quote
  #4 (permalink)  
Old 01-05-04, 15:19
certus certus is offline
Registered User
 
Join Date: Dec 2003
Location: Canada
Posts: 710
A foreign primary key.

(slipped in previous post while adding key's name)
__________________
visit: relationary
Reply With Quote
  #5 (permalink)  
Old 01-05-04, 17:22
blindman blindman is offline
World Class Flame Warrior
 
Join Date: Jun 2003
Location: Ohio
Posts: 11,726
You have two tables with a 1 to 1 relationship?

blindman
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