Skip to content

FLOAT

CREATE TABLE TestTable (
exampleField FLOAT(7,2)
);
INSERT INTO TestTable (exampleField)
VALUES (12345.67);
Query OK, 1 row affected (0.01 sec)

In the given example, a new table, TestTable, is created with one column, exampleField, of data type FLOAT(7,2). Then a data value 12345.67 is inserted into the column. The floating point type FLOAT(7,2) means that exampleField can store floating point numbers with up to 7 digits in total, of which 2 can be after the decimal point.