Cara PenulisanTipe Floating Point : FLOAT dan DOUBLE
 
 
Untuk tipe data FLOAT dan DOUBLE, format querynya adalah:
 
FLOAT[(M,D)] [UNSIGNED] [ZEROFILL]
DOUBLE[(M,D)] [UNSIGNED] [ZEROFILL]
 
Contoh pendefinisan tipe data floating point:
 
mysql> CREATE TABLE contoh_float (satuan FLOAT(3,2), puluhan FLOAT(4,2), 
ribuan FLOAT(5,2), positif DOUBLE ZEROFILL UNSIGNED, 
cantik DOUBLE(8,2) ZEROFILL);
Query OK, 0 rows affected (1.21 sec)
mysql> DESCRIBE contoh_float;
+---------+-------------------------------+------+-----+---------+-------+
| Field   | Type                          | Null | Key | Default | Extra |
+---------+-------------------------------+------+-----+---------+-------+
| satuan  | float(3,2)                    | YES  |     | NULL    |       |
| puluhan | float(4,2)                    | YES  |     | NULL    |       |
| ribuan  | float(5,2)                    | YES  |     | NULL    |       |
| positif | double unsigned zerofill      | YES  |     | NULL    |       |
| cantik  | double(8,2) unsigned zerofill | YES  |     | NULL    |       |
+---------+-------------------------------+------+-----+---------+-------+
5 rows in set (0.04 sec)
mysql> INSERT INTO contoh_float values ((1.3), (55.32), (523.77), 
(7832.3), (150000.45));
Query OK, 1 row affected (0.15 sec)
mysql> SELECT * FROM contoh_float;
+--------+---------+--------+------------------------+-----------+
| satuan | puluhan | ribuan | positif                | cantik    |
+--------+---------+--------+------------------------+-----------+
|   1.30 |   55.32 | 523.77 | 00000000000000007832.3 | 150000.45 |
+--------+---------+--------+------------------------+-----------+
1 row in set (0.00 sec)
 
 
Tutorial ini saya buat untuk keperluan anda,semoga bermanfaat ...