以下查询在创建 table 时出错

Below query is giving error in creating table

这个sql查询在执行时给我一个错误我无法理解问题出在哪里请在这里帮助我

CREATE TABLE failed: CREATE TABLE projects_of_1-2453852243(proj_id VARCHAR(256) NOT NULL PRIMARY KEY,
 title VARCHAR(256),
 mentor VARCHAR(128),
 team_leader VARCHAR(128),
 abstract TEXT, description MEDIUMBLOB,
 domain VARCHAR(80),
 department VARCHAR(80),
 reference VARCHAR(128),
 submission_yr int,
 proj_field VARCHAR(2))

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 '-2453852243(proj_id VARCHAR(256) NOT NULL PRIMARY KEY, title VARCHAR(256), mento' at line 1

在您的 table 名称 projects_of_1-2453852243 周围加上反引号,因为 - 不允许直接出现在标识符中。此外,PRIMARY KEY 已经是 NOT NULL。不需要用主键指定。

CREATE TABLE `projects_of_1-2453852243`(
 proj_id VARCHAR(256) PRIMARY KEY,
 title VARCHAR(256),
 mentor VARCHAR(128),
 team_leader VARCHAR(128),
 abstract TEXT, description MEDIUMBLOB,
 domain VARCHAR(80),
 department VARCHAR(80),
 reference VARCHAR(128),
 submission_yr int,
 proj_field VARCHAR(2))

或改用下划线:

CREATE TABLE projects_of_1_2453852243 (
 proj_id VARCHAR(256) PRIMARY KEY,
 title VARCHAR(256),
 mentor VARCHAR(128),
 team_leader VARCHAR(128),
 abstract TEXT, description MEDIUMBLOB,
 domain VARCHAR(80),
 department VARCHAR(80),
 reference VARCHAR(128),
 submission_yr int,
 proj_field VARCHAR(2))