-2
create table motors( 
 Id int(11) NOT NULL AUTO_INCREMENT primary key,
 Name varchar(255),
 Type varchar(100),
 Gage float(3,2),
 Turn int(2),
 Rpm int(4),
 Sloat int(2),
Group varchar(255),
Wire_Weight float(3,2),
Connection varchar(100),
Remark text,Created_Date datetime,
Modify_Date datetime);

i got error 1064 Server version: 5.7.29

ScaisEdge
  • 131,976
  • 10
  • 91
  • 107
  • Maybe it's caused by the use of `Group` as a field name, which is also a reserved word? – David Makogon May 11 '20 at 16:42
  • 2
    `1064` is a syntax error. But MySQL actually returns more information than just the number. How are you inspecting errors? What tool are you using to run your SQL? – Álvaro González May 11 '20 at 16:44
  • Does this answer your question? [Syntax error due to using a reserved word as a table or column name in MySQL](https://stackoverflow.com/questions/23446377/syntax-error-due-to-using-a-reserved-word-as-a-table-or-column-name-in-mysql) – user3783243 May 11 '20 at 16:53

1 Answers1

0

Group is a reserved term in MySQL. If you want you use names that are reserved you can use backticks, see the code below.

**Schema (MySQL v5.7)**


    create table motors
    (Id int(11) NOT NULL AUTO_INCREMENT primary key,
    Name varchar(255),
     Type varchar(100),
     Gage float(3,2),
     Turn int(2),
     Rpm int(4),
     Sloat int(2),
     `Group` varchar(255),
     Wire_Weight float(3,2),
     Connection varchar(100),
     Remark text,
     Created_Date datetime,
     Modify_Date datetime
    );

---

View on DB Fiddle

user3783243
  • 5,368
  • 5
  • 22
  • 41
ikiK
  • 6,328
  • 4
  • 20
  • 40