DECIMAL(7,2) : Decimal : Data Types MySQL TUTORIALS


MySQL TUTORIALS » Data Types » Decimal »

 

DECIMAL(7,2)


mysql>
mysql>
mysql> CREATE TABLE myTable
    -> (
    ->    ID SMALLINT,
    ->    Price DECIMAL(7,2),
    ->    Weight FLOAT(8,4)
    -> );
Query OK, 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    |       |
+--------+--------------+------+-----+---------+-------+
rows in set (0.02 sec)

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

mysql>



Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .

Follow Navioo On Twitter

MySQL TUTORIALS

 Navioo Data Types
» Decimal