MySQL错误 - 不确定SQL命令有什么问题

时间:2018-04-11 00:45:13

标签: mysql sql

CREATE TABLE Sponsors (
  `Id` int(11) NOT NULL AUTO_INCREMENT,
  `Sponsor_Id` int(11) DEFAULT NULL,
  `Runner_Id` int(11) DEFAULT NULL,
  `Charity_Id` int(11) DEFAULT NULL,
  `Subscription_Id` varchar(25) DEFAULT NULL,
  `Customer_Id` varchar(25) DEFAULT NULL,
  `Customer_Email` varchar(75) DEFAULT NULL,
  `APM` int(11) DEFAULT '1',
  `MinAPM` int(11) DEFAULT '5',
  `MaxAPM` int(11) DEFAULT '100',
  `Created_at` int(11) NOT NULL,
  `CharityId` int(11) NOT NULL,
  `CharityName` varchar(250) NOT NULL,
  `CharityCity` varchar(250) NOT NULL,
  `CharityState` varchar(250) NOT NULL,
  `CharityCategory` varchar(250) NOT NULL,
  `Total_Donations` int(11) NOT NULL,
  `Monthly_Donations` int(11) NOT NULL,
  `Distance` float NOT NULL,
  PRIMARY KEY (Id)
) 

1064 - 您的SQL语法出错;查看与您的MySQL服务器版本对应的手册,以便在'CREATE TABLE Sponsors(

)附近使用正确的语法

'Id'int(11)NOT NULL AUTO_INCREMENT,   'Sponsor_Id'

1 个答案:

答案 0 :(得分:-1)

CREATE TABLE Sponsors (
  `Id` int(11) AUTO_INCREMENT NOT NULL,
  `Sponsor_Id` int(11) DEFAULT NULL,
  `Runner_Id` int(11) DEFAULT NULL,
  `Charity_Id` int(11) DEFAULT NULL,
    primary key (id)
)