List:General Discussion« Previous MessageNext Message »
From:Martijn Tonies Date:March 12 2006 12:21pm
Subject:Re: SQL Foreign Key
View as plain text  
Hello Andreas,

You're not telling us what version of MySQL you're using,
so I'll have to give it a shot in the dark ...

> mysql> SHOW CREATE TABLE friends\G
> *************************** 1. row ***************************
>        Table: friends
> Create Table: CREATE TABLE `friends` (
>   `id` smallint(5) unsigned NOT NULL auto_increment,
>   `firstname` varchar(22) collate latin1_german2_ci default NULL,
>   `lastname` varchar(30) collate latin1_german2_ci default NULL,
>   `nick` varchar(20) collate latin1_german2_ci default NULL,
>   `birthdate` date default NULL,
>   `gender` enum('m','f') collate latin1_german2_ci default 'm',
>   `category` smallint(5) unsigned default '0',

----> create an index on the CATEGORY column and try again.

Martijn Tonies
Database Workbench - development tool for MySQL, and more!
Upscene Productions
My thoughts:
Database development questions? Check the forum!
SQL Foreign KeyAndreas Kr├╝ger12 Mar
  • Re: SQL Foreign KeyMartijn Tonies12 Mar