MySQL hates me - Won't allow VARCHAR as a Primary Key?
I'm attempting to create a table called Students, with only one field, student_name.

student_name should be a VARCHAR and a primary key, because I want to uniquely identify students by their name.

Here's the error message:

"Error while executing query.

CREATE TABLE 'swinters'.'Students' (

 'student_name' VARCHAR NOT NULL,

PRIMARY KEY ('student_name')

)

ENGINE = InnoDB;

MYSQL Error Number 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 'NOT NULL, PRIMARY KEY ('student_name') ) ENGINE = InnoDB' at line 2.


EDIT:

Ahhhhhhh! Just figured it out! Sorry for being super noob! Need to change VARCHAR to VARCHAR(45) or the like. Wow, sorry for that!
MySQL hates me - Won't allow VARCHAR as a Primary Key?
===

I'm attempting to create a table called Students, with only one field, student_name.

student_name should be a VARCHAR and a primary key, because I want to uniquely identify students by their name.

Here's the error message:

"Error while executing query.

CREATE TABLE 'swinters'.'Students' (

 'student_name' VARCHAR NOT NULL,

PRIMARY KEY ('student_name')

)

ENGINE = InnoDB;

MYSQL Error Number 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 'NOT NULL, PRIMARY KEY ('student_name') ) ENGINE = InnoDB' at line 2.


EDIT:

Ahhhhhhh! Just figured it out! Sorry for being super noob! Need to change VARCHAR to VARCHAR(45) or the like. Wow, sorry for that!