我無法在MySQL中創建這些表格。一切看起來都很完整,但我不斷收到錯誤。無法在MySQL中創建表格
這裏是我的SQL:
CREATE TABLE Movies(
title char PRIMARY KEY NOT NULL,
Years date NOT NULL,
length decimal not null,
genre char NOT NULL,
academy_award char not null,
FOREIGN KEY(the_name) REFERENCES Studio,
FOREIGN KEY(directorName) REFERENCES Director);
CREATE TABLE StarsIn(
FOREIGN KEY(title) REFERENCES Movies,
FOREIGN KEY(Years) REFERENCES Movies,
FOREIGN KEY(the_name) REFERENCES MovieStar);
CREATE TABLE Director(
the_name char PRIMARY KEY NOT NULL,
birthdate date NOT NULL,
nationality char NOT NULL);
CREATE TABLE MovieStar(
the_name char PRIMARY KEY NOT NULL,
birthdate date NOT NULL,
address char NOT NULL,
gender char NOT NULL);
CREATE TABLE Studio(
the_name char PRIMARY KEY NOT NULL,
address char NOT NULL);
如果您想要某人調試您的代碼,您應該發佈您正在獲取的錯誤... – evenro 2014-10-28 23:30:16
鍵列the_name在表錯誤中不存在。 – Rohit 2014-10-28 23:33:35
這是我第一次使用SQL,不知道如何創建一個表 – Rohit 2014-10-28 23:34:00