Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/mysql/66.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/apache-kafka/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Mysql 当我为外键运行此sql查询时出错_Mysql - Fatal编程技术网

Mysql 当我为外键运行此sql查询时出错

Mysql 当我为外键运行此sql查询时出错,mysql,Mysql,错误: CREATE TABLE module ( title VARCHAR(255), course_code INT(255), lecturer VARCHAR(255), PRIMARY KEY(course_code), FOREIGN KEY(lecturer)REFERENCES(name) ); 您忘了在引用之后包含表名 ERROR 1064 (42000) at line 32: You have an error in your S

错误:

CREATE TABLE module
(
    title VARCHAR(255),
    course_code INT(255),
    lecturer VARCHAR(255),
    PRIMARY KEY(course_code),
    FOREIGN KEY(lecturer)REFERENCES(name)
);

您忘了在引用之后包含表名

ERROR 1064 (42000) at line 32: 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 '(name)
)' at line 7

第32行是哪一行?在
外键
引用
之间是否缺少逗号?
CREATE TABLE module ( title VARCHAR(255), course_code INT(255), lecturer VARCHAR(255), PRIMARY KEY(course_code), FOREIGN KEY(lecturer) REFERENCES table(name) );