|
database
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Relationship between two tablesHi,
We can create more than one relationship between two tables. Could you tell me a situation where we need two relationships between two tables? Thanks Say you have a customers table and a table that represents a transaction between two customers holding two columns with a customer id. The referencing table would need to have two foreign keys pointing on the customerid
"§Chrissi§" <anubisofthyde***@hotmail.com> wrote in message news:OM$bER0VFHA.1404@TK2MSFTNGP09.phx.gbl... We can create more than one Hi, relationship between two tables. Could you tell me a situation where we need two relationships between two tables? Thanks Hi
You can have that kind of relationship but it violates 2nd and 3rd Normal Forms: For Eg: Table_Student Name Subject-ID Room-Number Table_Class Room Subject-ID Subject-Desc Room-Number was this your question? -- Show quotebest Regards, Chandra http://chanduas.blogspot.com/ http://www.developersdex.com/gurus/default.asp?p=4223 --------------------------------------- "§Chrissi§" wrote: > > You can have that kind of relationship but it violates 2nd and 3rd Normal Not necessarily. Suppose we have the followingCreate Table Employees ( Id Int Primary Key , LastName VarChar(25) , FirstName VarChar(25) ) Create Table ManagerStaff ( Id Int Primary Key , ManagerId Int References Employee(Id) , SubordinateId Int References Employee(Id) , StartDate DateTime , EndDate DateTime ) I have two relationships to the Employees table yes this is still normalized to third normal form. Thomas |
|||||||||||||||||||||||