Trying to create a table in mysql but i got a little trouble in my query

Viewed 12

I am trying to create a table in mysql but i got a little trouble in my query

CREATE TABLE Mastertbl(
mid int(11) PRIMARY KEY AUTO_INCREMENT NOT NULL,
    speciesName varchar(225) NOT NULL,
    localName varchar(225) NOT NULL,
    familyName varchar(225) NOT NULL,
    pila int(11) NOT NULL,
    areaNumber int(11) NOT NULL,
    plotNumber int(11) NOT NULL,
    Longitude double(225) NOT NULL,
    Latitude double(225) NOT NULL
);

Error:

#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ') , Latitude double(225) )' at line 9 –

1 Answers

You should replace last two column names like this:
Longitude DOUBLE(225,2) NOT NULL, Latitude DOUBLE(225,2) NOT NULL

Here, (M,D) means than values can be stored with up to M digits in total, of which D digits may be after the decimal point. For example, a column defined as DOUBLE(7,4) is displayed as -999.9999.

Related