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 > 1:1 relationship

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 09-18-03, 04:44
r123456 r123456 is offline
Registered User
 
Join Date: Sep 2003
Location: The extremely Royal borough of Kensington, London
Posts: 778
1:1 relationship

Hi,

I have the following constraints
An employee can manage @ most 1 department
A department can have @ most 1 manager

Thus by the rules of "pick a relationship and include the fk in x etc.", I have

Employee_ID(PK) | Department_Id

Data =
1 - DA
2 - DB
3 - DB
4 - DA

Clearly the above violations have been violated. I do not understand
Reply With Quote
  #2 (permalink)  
Old 09-18-03, 06:22
andrewst andrewst is offline
Moderator.
 
Join Date: Sep 2002
Location: UK
Posts: 5,171
Re: 1:1 relationship

You would need to add a UNIQUE constraint on employee.department_id to prevent setting up many employees as manager of same department.
__________________
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