MySQL: Integer & String types
| Type | Storage(bytes) | Minimum Value | Maximum Value |
| TINYINT | 1 | -128/0 | 127/255 |
| SMALLINT | 2 | -23768/0 | 23767/65535 |
| MEDIUMINT | 3 | -8388608/0 | 8388607/16777215 |
| INT/INTEGER | 4 | -2147483648/0 | 2147483647/4294967295 |
| BIGINT | 8 | -9223372036854775808/0 | -9223372036854775807/18446744073709551615 |
| char(n) | 定长 | 索引效率高 程序里面使用trim去除多余的空白 | n 必须是一个介于 1 和 8,000 之间的数值,存储大小为 n 个字节 |
| varchar(n) | 变长 | 效率没char高 灵活 | n 必须是一个介于 1 和 8,000 之间的数值。存储大小为输入数据的字节的实际长度,而不是 n 个字节 |
| text(n) | 变长 | 非Unicode数据 | |
| nchar(n) | 定长 | 处理unicode数据类型(所有的字符使用两个字节表示) | n 的值必须介于 1 与 4,000 之间。字节的存储大小为 n 的两倍 |
| nvarchar(n) | 变长 | 处理unicode数据类型(所有的字符使用两个字节表示) | n 的值必须介于 1 与 4,000 之间。字节的存储大小是所输入字符个数的两倍。所输入的数据字符长度可以为零 |
| ntext(n) | 变长 | 处理unicode数据类型(所有的字符使用两个字节表示) |
MySQL: Integer & String types的更多相关文章
- mysql integer size 大小
I was always wondering what the size of numeric columns in MySQL was. Forgive me if this is obvious ...
- How to: Convert Between Various String Types
This topic demonstrates how to convert various Visual C++ string types into other strings. The str ...
- fastjson在将Map<Integer, String>转换成JSON字符串时,出现中文乱码问题
fastjson在将Map<Integer, String>转换成JSON字符串时,出现中文乱码问题. 先记下这个坑,改天在看看是怎么导致的,暂时通过避免使用Integer作为键(使用St ...
- mysql Integer Types (Exact Value) - INTEGER, INT, SMALLINT, TINYINT, MEDIUMINT, BIGINT
使用mysql的时候,用到int类型的蛮多,需要注意一下: 1. 值的范围 Type Storage Minimum Value Maximum Value (Bytes) (Signed/Uns ...
- mysql string types ---- mysql 字符类型详解
一.mysql 中包涵的字符类型: [national] char [(m)] [character set charset_name] [collate collation_name] [natio ...
- java中Integer,String判断相等与integer的比较大小
package sfk.bbs.test.springjsbctempletTest; import static org.junit.Assert.*; import org.junit.Test; ...
- LeetCode 8 String to Integer (string转int)
题目来源:https://leetcode.com/problems/string-to-integer-atoi/ Implement atoi to convert a string to an ...
- int integer string间的转换
1.int-->Integer new Integer(i); 2.Integer-->int Integer i = new Integer(1); int k = i.intValue ...
- 【LeetCode】7 & 8 - Reverse Integer & String to Integer (atoi)
7 - Reverse digits of an integer. Example1: x = 123, return 321Example2: x = -123, return -321 Notic ...
随机推荐
- Struts 2 入门
Struts 2 入门: 一:Struts 2执行流程: 1 客户端发送请求: 2这个请求经过一系列的过滤器(Filter)(这些过滤器中有一个叫做ActionContextCleanUp的可选过滤 ...
- 小白关于python 对象和内存的关系的一些感悟和疑惑,望大神指教
首先你输入了一个字符串,这个字符串是有大小的,电脑将其放在内存中,自动给其一个起始指针指向这个字符串的首位置,然后,你将这个字符串赋值给一个变量,这个对象又在内存中开辟出一个空间,这个变量会自动连接这 ...
- 天梯赛 L2-020. 功夫传人 BFS
L2-020. 功夫传人 时间限制 400 ms 内存限制 65536 kB 代码长度限制 8000 B 判题程序 Standard 作者 陈越 一门武功能否传承久远并被发扬光大,是要看缘分的.一般来 ...
- 自己动手写http服务器——线程池(一)
创建一个线程池,每有一个连接对象就将它添加到工作队列中,线程池中的线程通过竞争来取得任务并执行它(它是通过信号量实现的). //filename threadpool.h #ifndef THREAD ...
- arguments.callee的临时指向特性
function r(){ alert('BBB'); } var a = { f: function(){ alert('AAA'); arguments.callee = r; } }; 弹出的都 ...
- Loadrunner 中时间戳函数 web_save_timestamp_param(时间返回数值)
web_save_timestamp_param("tStamp", LAST); lr_output_message("Moon1:%s",lr_eval_s ...
- 关于myeclipse8.6的优化设置
1.设置一些类型文件的编码格式: >preferences>General>Content Types>Text>javaScript sourcefile 相同的操作 ...
- string的内存管理问题
string的内存管理是通过仅仅增不减的方式进行的,string的clear方法不会真正的释放内存,假设须要真正的释放内存可以连续调用string的这两个方法.resize(0),reserve(). ...
- hdu 5635 LCP Array(BC第一题)
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5635 LCP Array Time Limit: 4000/2000 MS (Java/Others) ...
- ML学习分享系列(2)_计算广告小窥[中]
原作:面包包包包包包 改动:寒小阳 && 龙心尘 时间:2016年2月 出处:http://blog.csdn.net/Breada/article/details/50697030 ...