# Decimal and Numeric Data Field Syntax When 123.4567 Is Inserted : Decimal « Data Type « SQL / MySQL

Home
SQL / MySQL
 1 Aggregate Functions 2 Backup Load 3 Command MySQL 4 Cursor 5 Data Type 6 Database 7 Date Time 8 Engine 9 Event 10 Flow Control 11 FullText Search 12 Function 13 Geometric 14 I18N 15 Insert Delete Update 16 Join 17 Key 18 Math 19 Procedure Function 20 Regular Expression 21 Select Clause 22 String 23 Table Index 24 Transaction 25 Trigger 26 User Permission 27 View 28 Where Clause 29 XML
 SQL / MySQL » Data Type » Decimal
Decimal and Numeric Data Field Syntax When 123.4567 Is Inserted
 ```     +------------+-------------+---------+----------------------------------------------+  | Syntax     |Code         | Display |Description                                   | +------------+-------------+---------+----------------------------------------------+  |DECIMAL(w,d)|DECIMAL(5,2) |123.46   |Number has been rounded up                    | +------------+-------------+---------+----------------------------------------------+  |NUMERIC(w,d)|NUMERIC(7,4) |123.4567 | Exact fit. (7 digits, 4 decimal places)      | +------------+-------------+---------+----------------------------------------------+  |DECIMAL(w)  |DECIMAL(9)   |123      |No decimal specified: defaults to 0 decimal.  | |            |             |         |(9 digits, 6 padded places to left of number) | +------------+-------------+---------+----------------------------------------------+  |DECIMAL     |DECIMAL      |123      |Default: 10 digits, 0 decimal places.         |     |            |             |         | (10 digits, 7 padded places to left of number)| +------------+-------------+---------+----------------------------------------------+                                         ```
Related examples in the same category
 1 NUMERIC, DEC Synonym for DECIMAL 2 DECIMAL(p, s) Fixed-point number, saved as a character string; 3 DECIMAL(4,2) for price 4 Insert value to a decimal value column 5 DECIMAL(7,2) 6 DECIMAL(7,2) ZEROFILL NOT NULL 7 Update decimal value 8 Decimal default value