List:General Discussion« Previous MessageNext Message »
From:David Blomstrom Date:May 13 2004 4:45am
Subject:Re: From the top! (primary/foreign keys)
View as plain text  
BINGO! About the same time I got your message, I
figured out how to create foreign keys with SQLyog. I
followed your instructions in creating two brand new
tables in phpMyAdmin, then linked the foreign key and
primary key in SQLyog.

I haven't tested it yet - there isn't even any data in
the tables yet - but I see this message under
Comments:

"InnoDB free: 3072 kB; [CCode] REFER
world/continentsx[CCode]

(I named my new experimental tables continentsx and
nationsx. I should name one Ligaya in your honor! :)

--- Ligaya Turmelle <lig@stripped> wrote:
> CREATE TABLE Continent (
>  CCODE  VARCHAR(6)  NOT NULL  UNIQUE,
>  CGROUP VARCHAR(255),
>  TYPE VARCHAR(255),
>  NAME VARCHAR(255),
>  NUM_ID INT(4)  NOT NULL UNIQUE,
>  PRIMARY KEY (CCODE),
>  TYPE = InnoDB);
> 
> 
> CREATE TABLE Nations (
>  NAME VARCHAR(255) NOT NULL  UNIQUE,
>  TYPE VARCHAR(255),
>  NCODE VARCHAR(6),
>  CCODE VARCHAR(6),
>  PRIMARY KEY (NAME),
>  INDEX (CCODE),
>  FOREIGN KEY (CCODE) REFERENCES Continent(CCODE)
>    ON DELETE RESTRICT
>    ON UPDATE CASCADE)
>  TYPE = InnoDB;


	
		
__________________________________
Do you Yahoo!?
Yahoo! Movies - Buy advance tickets for 'Shrek 2'
http://movies.yahoo.com/showtimes/movie?mid=1808405861 
Thread
From the top! (primary/foreign keys)David Blomstrom13 May
  • Re: From the top! (primary/foreign keys)Ligaya Turmelle13 May
    • Re: From the top! (primary/foreign keys)David Blomstrom13 May
    • Re: From the top! (primary/foreign keys)David Blomstrom13 May