Re: SQL Database design question

From: Neo <neo55592_at_hotmail.com>
Date: 28 Jan 2005 20:16:34 -0800
Message-ID: <1106972194.842055.58380_at_c13g2000cwb.googlegroups.com>


> .. This is a classic many-to-many relationship...

Yes, it is similar to the "Employee Works_On Project" example on p54 of "Fund of Db Sys", Elmasri and Navathe, 2nd Ed. I was wondering, if the table is named T_EmployeeBranch (as shown below), how does the db know the relationship between employee and branch? If the table is named T_WorksAt, how does the db know if "John worksAt research" vs "research worksAt John", since column order should be irrelevant?

T_EmployeeBranch or T_WorksAt



ID EmpID BranchID
-- ----- ------
01 john research
02 mary research
03 mary mfgPlt10

// In the experimental db:
// Find relationships between John and Research.
// Find the verb worksAt.

(SELECT john.% = research)

// Find the relationship between Research and John.
// Finds nothing.

(SELECT research.% = john) Received on Sat Jan 29 2005 - 05:16:34 CET

Original text of this message