I created database and named it table1 , My sql code is given how to fix this error?

47 Views Asked by At
mysql> use table1;
Database changed
mysql> create table customer(cust_no varchar(5),cust_name varchar(15),age number,phone number(15));
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 'number,phone number(15))' at line 1
mysql>
2

There are 2 best solutions below

0
Mureinik On

MySQL dones't have a number datatype. It is called numeric.

0
Anynamer On

Try this instead, simply changing to accepted datatypes:

create table customer(cust_no varchar(5), cust_name varchar(15), age 
tinyint, phone varchar(15));