Error creating table in MySQL

4

I want to create a requested table in mysql, and it throws this at me:

Executed SQL Statement:

Create table 'deliverytrackingdb'.'pedido'(  
  'id' int(4) NOT NULL AUTO_INCREMENT,

  'precio' double(5) NOT NULL,

  'descripcion' varchar(200) NOT NULL,

  'direccion' varchar(200) NOT NULL,

  'comentario' varchar(200),

  'estado' enum('En preparación','Preparado','Asignado a repartidor','En reparto','Entregado') NOT NULL,

  primary key ('id')
) ENGINE=InnoDB
  

Error Number: 1064   Error Message: 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,

     

descripcion varchar (200) NOT NULL,
direccion varchar (200) 'at line 3

    
asked by Juan Manuel 01.11.2016 в 22:42
source

2 answers

4

Remove the value in parentheses from the value of the double:

'precio' double NOT NULL,
    
answered by 01.11.2016 / 22:58
source
0

The data type varchar is not marked in "azulito" , it may not be the appropriate syntax, you can use Char(n) : It stores a fixed length string. The string may contain from 0 to 255 characters.

    
answered by 01.11.2016 в 22:59