1

going to create a data table in mysql using cli. I have following sql command,

mysql> CREATE TABLE Customer(
    ->  id VARCHAR(20),
    ->  name VARCHAR(20) NOT NULL ,
    ->  dob DATE NULL,
    ->  gender INT NULL,
    ->  phone STRING,
    ->  mobile STRING,
    ->  nic STRING NULL,
    ->  country STRING,
    ->  address STRING,
    ->  region STRING,
    ->  city STRING,
    ->  state STRING,
    ->  postalcode STRING,
    ->  endorser1 STRING,
    ->  endorser2 STRING,
    ->  email STRING,
    ->  comment STRING,
    ->  image STRING,
    ->  type INT,
    ->  CONSTRAINT PRIMARY KEY (id)
    -> );

but when I try to execute command got following error message

ERROR 1064 (42000): 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 'STRIN
G,
 mobile STRING,
 nic STRING NULL,
 country STRING,
 address STRING,
 reg' at line 6
mysql> ^A

how to fix this problem?

Federico klez Culloca
  • 26,308
  • 17
  • 56
  • 95
Ranawaka
  • 63
  • 7

0 Answers0