On Friday 07 March 2003 00:43, Chris Montgomery wrote:

> I have been using MS Access for 5+ years and am new to MySQL. I
> understand the theory behind setting relationships between tables, but
> am trying to get up to speed in how to do it in MySQL.
>
> My environment: Win2k and MySQL 3.23.54
>
> Here's what I want to do: I have two tables, categories and businesses,
> and I want to create a relationship between them based on the Node field
> (primary key in the categories table, foreign key in the businesses
> table). I guess what I fully don't understand yet is the order to do
> this: create indexes on the key/foreign key fields and then create
> foreign key constraints or vice versa?

[skip]

> I've tried using a couple of GUI front-ends to manage this but keep
> getting errors when setting up the foreign key relationships. Can
> someone please point me in the right direction? Many thanks in advance.

Both columns Node are indexed, so just add foreign key constraint. You can 
find examples in the InnoDB manual:
        http://www.innodb.com/ibman.html#InnoDB_foreign_keys



-- 
For technical support contracts, goto https://order.mysql.com/?ref=ensita
This email is sponsored by Ensita.net http://www.ensita.net/
   __  ___     ___ ____  __
  /  |/  /_ __/ __/ __ \/ /    Egor Egorov
 / /|_/ / // /\ \/ /_/ / /__   [EMAIL PROTECTED]
/_/  /_/\_, /___/\___\_\___/   MySQL AB / Ensita.net
       <___/   www.mysql.com




---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to