这是我的架构:
CREATE TABLE item (
id integer NOT NULL PRIMARY KEY AUTO_INCREMENT,
title varchar(60) NOT NULL,
description varchar(900) NOT NULL,
company_id integer NOT NULL REFERENCES company (id),
date datetime NOT NULL,
source_id integer NOT NULL REFERENCES source (id),
link varchar(255) NOT NULL,
location_id integer NOT NULL REFERENCES location (id)
);
CREATE TABLE location (
id integer NOT NULL PRIMARY KEY AUTO_INCREMENT,
name varchar(255) NOT NULL,
coordinate varchar(255) NOT NULL,
location_id integer NOT NULL REFERENCES country (id)
);
CREATE TABLE country (
id integer NOT NULL PRIMARY KEY AUTO_INCREMENT,
name varchar(255) NOT NULL
);
CREATE TABLE company (
id integer NOT NULL PRIMARY KEY AUTO_INCREMENT,
name varchar(60) NOT NULL,
);
CREATE TABLE source (
id integer NOT NULL PRIMARY KEY AUTO_INCREMENT,
name varchar(60) NOT NULL,
);
当我将其放入并单击构建模式时,它告诉我http://sqlfiddle.com上的第四行存在无效语法。我看不出有什么错误,有人能解释一下吗?
另外,如果我做的不好或做出了错误的决定,请告诉我。