Ted,

If in fact you only have a one-to-many relationship, you don't need the 
third table (what's also known as a join table in some circles). This 
type of table is only really needed if you are doing a many-to-many 
(people have 0 to infinity machines, and machines have 0 to infinity 
people).

I fail to see how adding a layer of complexity would help when deleting 
or updating records. Unless, of course, you are doing transaction 
logging manually. Which might be necessary with some DBMS products, but 
I don't think you need to in MySQL because you have the binary and 
other logs available. But then, you would need more information in the 
third table than just the two primary keys. I wouldn't mind hearing 
from your friend about why this type of set up is beneficial.

jeff

On Fri, 06 Jun 2003 02:14:37 -0400, [EMAIL PROTECTED] wrote:
> I have a friend teaching me but I want more :-) (second opinions), please.
> 
> A simple Database:
> 2 tables
> a one-to-many relationship
> each table has a Primary Key:  table1 (one) Primary Key = peopleID; 
> table2 (many) Primary Key = machinesID
> 
> Normally, I would put the peopleID also in table2 as a Foreign key to 
> establish the relationship and be done with it.
> 
> I am being taught now to create a third table, table3, and in it have 
> 2 columns; those being the peopleID and machinesID (the Primary keys 
> from the other 2 tables).  This is apparently a good idea when it 
> comes to deleting or updating records. (?)
> 
> My question is, how is the relationship between table1 and table2 
> established using this method?
> 
> I hope you understand my question.  If I try to explain further it 
> will only become convoluted, possibly more than it is!
> 
> Thanks,
> Ted Rogers

---
Listserv only address.
Jeff Shapiro

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to