Database type of column:
Currently, there are only 2 kinds of types: int, char
Column type:
1. Number types
2. String type
3. Date type
Integer type in number type:
Tinyint of 1 bytes -128~127
SmallInt of 2 bytes -32768~32767
Mediumint of 3 bytes-8388608 ~ 8388607
int accounted for 4 bytes -2147483648~2147483647
BigInt occupies 8 bytes anyway the range is larger than int.
How do you choose these integer types when you use them in peacetime? Choose according to your business needs.
When we define a column type, we can also indicate unsigned.
All the columns of the T1 table are now unsigned.
At this point the unsigned case:
Tinyint of 1 bytes 0~255
SmallInt of 2 bytes 0~65535
Other slightly.
Supplement: 0 padding. The key word is Zerofill
Floating-point types:
Float accounts for 4 bytes and 7 digits in a valid number.
Double is a valid number of 8 bytes 15~16 digits.
Note that the result shows that the precision is lost because of the float and double significant digits.
What to note about floating-point types:
1. You can specify the number of columns that float and doouble are integers, and the number of columns that the decimals occupy.
Floating-point numbers also support scientific notation:
12345678 = 1.2345678e7
123456 = 1.23456e5
If you deal with money, you must not use float and double to deposit money. This leads to the one type: fixed-point number: decimal
650) this.width=650; "Src=" Http://s4.51cto.com/wyfs02/M01/84/03/wKioL1eDUKHALfHfAAjvwDrTZp4879.jpg-wh_500x0-wm_3 -wmp_4-s_3389825700.jpg "title=" alt= "Wkiol1edukhalfhfaajvwdrtzp4879.jpg-wh_50"/>
Jia Yue (Shenzhen) technology Co., Ltd.
Beauty comes from here.
: Jajoyyojoy
Micro-Blog: Http://weibo.com/JaJoy
Official website: http://www.galajoy.com/
650) this.width=650; "src=" http://s4.51cto.com/wyfs02/M00/84/04/wKiom1eDUSeRJP2HAAYnwk9gnr0022.jpg "title=" "Best Hyatt. jpg" "alt=" Wkiom1eduserjp2haaynwk9gnr0022.jpg "/>
Data types for database forms