初学菜鸟写了个创建表的命令,mysql一直提示有错,可是我怎么也检查不出来错误:
CREATETABLEinterests(int_idINTNOTNULLAUTO_INCREMENTPRIMARYKEY,interestVARCHAR(50)NOTN...
CREATE TABLE interests
(
int_id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
interest VARCHAR(50) NOT NULL,
contact_id INT NOT NULL,
CONSTRAINT my_contacts_contact_id_fk
FOREIGN KEY(contact_id)
REFERENCES my_contacts(contact_id)
);
mysql提示:You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘KEY(KEY(contact_id)
REFERENCES my_contacts(contact_id)’ at line 1 展开
(
int_id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
interest VARCHAR(50) NOT NULL,
contact_id INT NOT NULL,
CONSTRAINT my_contacts_contact_id_fk
FOREIGN KEY(contact_id)
REFERENCES my_contacts(contact_id)
);
mysql提示:You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘KEY(KEY(contact_id)
REFERENCES my_contacts(contact_id)’ at line 1 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询