0
  DROP TABLE IF EXISTS group ;
 CREATE TABLE group (id_group INT(10)  AUTO_INCREMENT NOT NULL,
 title_group VARCHAR(200),
 discription_group VARCHAR(200),
 image_group VARCHAR(200),
 date_group DATE,
 id_user INT(10),
 id_category INT(10),
 PRIMARY KEY (id_group) ) ENGINE=InnoDB;

Error

Static analysis:

2 errors were found during analysis.

An expression was expected. (near "group" at position 21)
Unrecognized keyword. (near "group" at position 21)

SQL query:

DROP TABLE IF EXISTS group

MySQL said #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'group' at line 1

Bynd
  • 675
  • 1
  • 15
  • 40

1 Answers1

1

group is reserve keyword.

You can use below statement.

DROP TABLE IF EXISTS `group` ;
CREATE TABLE `group` (
    id_group INT(10)  AUTO_INCREMENT NOT NULL,
    title_group VARCHAR(200),
    discription_group VARCHAR(200),
    image_group VARCHAR(200),
    date_group DATE,
    id_user INT(10),
    id_category INT(10),
    PRIMARY KEY (id_group)
) ENGINE=InnoDB;
Manoj Sharma
  • 1,467
  • 2
  • 13
  • 20