> [EMAIL PROTECTED] wrote: >>> DVD_Actor: >>> dvd_ID REFERENCES DVD >>> actor_ID REFERNCES Actor >> >> Is this how you setup a join table ? > > Yes. > > >> what exactly is the references keyword ? > > It indicates a foreign key. Full syntax is something like: > dvd_ID CONSTRAINT dvc_fk FOREIGN KEY REFERENCES DVD (dvd_ID) > > Read the manual *very* carefully before using foreign keys in > MySQL when you have an Oracle background. > > Jochem
Ok i'm setting up the foreign key relations in the main table is that bad ? I use a join table for a one to many situation. The cool thing about setting it up in the main table is, say you delete an actor you can setup a cascade delete to delete all the dvd titles aswell ;) I'm using sqlyog which has a nice relationship setup feature. > > -- > I don't get it > immigrants don't work > and steal our jobs > - Loesje -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]