Can anyone find the error in this MySQL code? (Beginner)
<p><br /></p>
<pre class="brush:php;toolbar:false;">CREATE TABLE `students`.`studentinfo` (
id int,
name varchar,
age int
);
ENGINE=InnoDB
COMMENT = 'test';</pre>
<p>I'm using MySQL workbench and I'm trying to create a table called students. However, my code gives the error message </p>
<pre class="brush:php;toolbar:false;">Operation failed: There was an error while applying the SQL script to the database.
Executing:
CREATE TABLE `students`.`studentinfo` (
id int,
name varchar,
age int
);
ENGINE=InnoDB
COMMENT = 'test';
ERROR 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 ',
age int
)' at line 3
SQL Statement:
CREATE TABLE `students`.`studentinfo` (
id int,
name varchar,
age int
)</pre>
<p>I tried to solve the problem by removing the table, like this:</p>
<pre class="brush:php;toolbar:false;">CREATE TABLE `students`.`studentinfo` (
)
ENGINE=InnoDB
COMMENT = 'test';</pre>
<p>Even then, it still doesn't work! It gives the same error message:</p>
<pre class="brush:php;toolbar:false;">Operation failed: There was an error while applying the SQL script to the database.
Executing:
CREATE TABLE `students`.`studentinfo` (
)
ENGINE=InnoDB
COMMENT = 'test';
ERROR 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 ')
ENGINE=InnoDB
COMMENT = 'test'' at line 2
SQL Statement:
CREATE TABLE `students`.`studentinfo` (
)
ENGINE=InnoDB
COMMENT = 'test'</pre>
<p><br /></p>