无法弄清楚我的SQL语句完整错误消息是什么问题
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'NOT NULL ,
`Sex` BOOLEAN NOT NULL ,
PRIMARY KEY(userID)
)' at line 7
实际代码是
CREATE TABLE `car_rental`.`users` (
`userID` int(9) AUTO_INCREMENT NOT NULL ,
`First Name` VARCHAR(25) NOT NULL ,
`Last Name` VARCHAR(55) NOT NULL ,
`E-mail Address` VARCHAR(55) NOT NULL ,
`Age` INT NOT NULL ,
`Password` VARCHAR NOT NULL ,
`Sex` BOOLEAN NOT NULL ,
PRIMARY KEY(userID)
)
ENGINE = InnoDB;
答案 0 :(得分:1)
错误主要是因为:
`Password` VARCHAR NOT NULL
将其更改为:
`Password` VARCHAR(60) NOT NULL
希望这有帮助。