create table command doesn't work

I have a new installed mysql server. when i tried to run the following command, it gave me error as below, please help.

mysql> create table student(
    ->     -> fist_name varchar(30) not null,
    ->     -> last_name varchar(30) not null,
    ->     -> email varchar(60) null,
    ->     -> street varchar(50) not null,
    ->     -> city varchar(40) not null,
    ->     -> state char(2) not null default "CA",
    ->     -> zip mediumint unsigned not null,
    ->     -> phone varchar(20) not null,
    ->     -> birth_date DATE not null,
    ->     -> sex enum('M','f') not null,
    ->     -> date_entered timestamp,
    ->     -> lunch_cost float null,
    ->     -> student_id int unsigned not null auto_increment primary key
    -> );
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corre                                                t syntax to use near '-> fist_name varchar(30) not null,
    -> last_name varchar(30) not null,
    ->' at line 2
Jason YuAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Daniel WilsonCommented:
It looks like you copied in too many tabs.  More than 1 tab per line causes problems.  Delete a bunch of those in your text editor and paste in the script again.

And while you're at it ... you may mean first_name instead of fist_name.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Haris DulicIT ArchitectCommented:
Hi,

when you remove -> then the syntax is ok.. Here is the code that works
 create table student(
          fist_name varchar(30) not null,
          last_name varchar(30) not null,
          email varchar(60) null,
          street varchar(50) not null,
          city varchar(40) not null,
          state char(2) not null default "CA",
          zip mediumint unsigned not null,
          phone varchar(20) not null,
          birth_date DATE not null,
          sex enum('M','f') not null,
          date_entered timestamp,
          lunch_cost float null,
          student_id int unsigned not null auto_increment primary key
     );

Open in new window


You can check it here http://sqlfiddle.com/#!9/1d3af/1 just Build the schema
0
Jason YuAuthor Commented:
got it, after I copied your code, it worked now.
0
Jason YuAuthor Commented:
great answer, thank you.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Web Browsers

From novice to tech pro — start learning today.