MySQL Forums
Forum List  »  Newbie

Newbie Create Table syntax
Posted by: Neil Harrison
Date: June 09, 2006 02:23AM

Hi,
I'm using MySQL 5.0.22-communnity-nt
Ive created a database called NEIL, that bit went ok.
I typed USE NEIL; in the command line, that bit went ok.
I typed CREATE TABLE checks
->(check numeric(6) not null,
->payee varchar(20) not null,
->amount decimal(6,2) not null,
->remarks varchar(20) not null);

this is where I get an error message ERROR 1064 (42000) ..check syntax near 'numeric(6) not null,
payee varchar(20) not null,
amount decimal(6,2) not null,
r' at line 2

I typed this above example table, word for word from SAMS Teach Yourself SQL in 21 Days. I've also checked the MySQL 5.0 manual for the correct syntax and it is the same as above.
Ive changed the word not (as in not null) to the symbol '<>' and this changes the error message to read
check syntax near (check numeric(6) <> null,
payee varchar(20) <> null
at line 1

Am i missing something glaringly obvious??
Any help would be appreciated. Cheers.

Options: ReplyQuote


Subject
Written By
Posted
Newbie Create Table syntax
June 09, 2006 02:23AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.