DECIMAL(7,2) : Decimal « Data Types « MySQL Tutorial






mysql>
mysql>
mysql> CREATE TABLE myTable
    -> (
    ->    ID SMALLINT,
    ->    Price DECIMAL(7,2),
    ->    Weight FLOAT(8,4)
    -> );
Query OK, 0 rows affected (0.05 sec)

mysql>
mysql> desc myTable;
+--------+--------------+------+-----+---------+-------+
| Field  | Type         | Null | Key | Default | Extra |
+--------+--------------+------+-----+---------+-------+
| ID     | smallint(6)  | YES  |     | NULL    |       |
| Price  | decimal(7,2) | YES  |     | NULL    |       |
| Weight | float(8,4)   | YES  |     | NULL    |       |
+--------+--------------+------+-----+---------+-------+
3 rows in set (0.02 sec)

mysql>
mysql> drop table myTable;
Query OK, 0 rows affected (0.00 sec)

mysql>








10.8.Decimal
10.8.1.DECIMAL[(M[,D])] [UNSIGNED] [ZEROFILL]
10.8.2.DECIMAL(7,2)
10.8.3.For inserts into a DECIMAL or integer column