MySQL table with a varchar column as foreign key
问题 I am trying to create a table with a varchar column as foreign key but MySql gives me an error while creating the table. My query is like this: CREATE TABLE network_classes ( id TINYINT(1) UNSIGNED NOT NULL AUTO_INCREMENT, category VARCHAR(80) NOT NULL, PRIMARY KEY(id), KEY `key_1` (`id`,`category`) ) ENGINE=InnoDB; CREATE TABLE networks ( id TINYINT(3) UNSIGNED NOT NULL AUTO_INCREMENT, name VARCHAR(100) NOT NULL, category VARCHAR(80) NOT NULL, director_id TINYINT(3) UNSIGNED NULL, director