SQL 不同的数据类型
SQL 不同的数据类型
1、SQL TEXT
2、SQL VARCHAR(SIZE)
VARCHAR(X)
Case: user name, email, country, subject, password
TEXT
Case: messages, emails, comments, formatted text, html, code, images, links
MEDIUMTEXT
Case: large json bodies, short to medium length books, csv strings
LONGTEXT
Case: textbooks, programs, years of logs files, harry potter and the goblet of fire, scientific research logging
REFER: MySQL: TEXT vs. VARCHAR Performance
REFER: Datatypes In SQLite Version 3
3、SQLITE Datatype
Most SQL database engines (every SQL database engine other than SQLite, as far as we know) uses static, rigid typing. With static typing, the datatype of a value is determined by its container - the particular column in which the value is stored.
大部分SQL database engies(迄今为止,除了SQLITE之外的 database engine) 使用 static/静态的, rigid-typing/严格 typing的。 使用 static-typing,某个值的 datatype/数据类型 由其所在的 container/容器 定义。
SQLite uses a more general dynamic type system. In SQLite, the datatype of a value is associated with the value itself, not with its container. The dynamic type system of SQLite is backwards compatible with the more common static type systems of other database engines in the sense that SQL statements that work on statically typed databases should work the same way in SQLite. However, the dynamic typing in SQLite allows it to do things which are not possible in traditional rigidly typed databases.
SQLITE 使用一种 比较通用的 动态类型系统/dynamic-type-system. 在 SQLITE中,值的 datatype 是和 值本身 密切相关的,而不是其所在的容器。SQLITE中的动态类型系统 与 传统的 static-type 后向兼容/backwards-compatible,也就是说 可以在 static-typed-database工作的 SQL-statements 同样可以在 SQLITE 中使用。
Each value stored in an SQLite database (or manipulated by the database engine) has one of the following storage classes:
存储在SQLITE-database 中的所有值 都有下面一种 storage-class/存储类???。
NULL. The value is a NULL value.
INTEGER. The value is a signed integer, stored in 1, 2, 3, 4, 6, or 8 bytes depending on the magnitude of the value.
REAL. The value is a floating point value, stored as an 8-byte IEEE floating point number.
TEXT. The value is a text string, stored using the database encoding (UTF-8, UTF-16BE or UTF-16LE).
BLOB. The value is a blob of data, stored exactly as it was input.
参考:
SQL 不同的数据类型的更多相关文章
- SQL Server常见数据类型介绍
数据表是由多个列组成,创建表时必须明确每个列的数据类型,以下列举SQL Server常见数据类型的使用规则,方便查阅. 1.整数类型 int 存储范围是-2,147,483,648到2,147,483 ...
- hibernate中java类的成员变量类型如何映射到SQL中的数据类型变化
hibernate映射文件??.hbm.xml配置映射元素详解--Hibernate映射类型 在从Hibernate的java的成员类型映射到SQL中的数据类型,其内映射方式它满足,SQL可以自己调制 ...
- Sql Server之数据类型详解
数据类型是一种属性,用于指定对象可保存的数据的类型,SQL Server中支持多种数据类型,包括字符类型.数值类型以及日期类型等.数据类型相当于一个容器,容器的大小决定了装的东西的多少,将数据分为 ...
- SQL中sysname数据类型的含义(转)
sysname SQL Server 实例包括用户定义的名为 sysname 的数据类型.sysname 用于表列.变量以及用于存储对象名的存储过程参数.sysname 的精确定义与标识符规则相关:因 ...
- SQL Server 常见数据类型介绍
数据表是由多个列组成,创建表时必须明确每个列的数据类型,以下列举SQL Server常见数据类型的使用规则,方便查阅. 整数类型 int 存储范围是-2,147,483,648到2,147,483,6 ...
- 说说SQL Server的数据类型
以SQL Server为例,SQL Server的数据类型总共有33种,归纳为一下类别: 精确数字 Unicode字符串 近似数字 二进制字符串 日期和时间 其他数据类型 字符串 1.数字数据类型 ...
- SQL SERVER的数据类型
1.SQL SERVER的数据类型 数据类弄是数据的一种属性,表示数据所表示信息的类型.任何一种计算机语言都定义了自己的数据类型.当然,不同的程序语言都具有不同的特点,所定义的数据类型的各类和名称都或 ...
- sql server 字符数据类型
SQL Server 中字符类型包括varchar.char.text等.主要用于存储字符数据.varchar和char类型的主要区别在于数据填充.例如,一个列名为FirstName且数据类型为var ...
- Caused by: java.sql.SQLSyntaxErrorException: ORA-00932: 数据类型不一致: 应为 NUMBER, 但却获得 BINARY
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvo ...
随机推荐
- Sql sp_executesql 参数问题
DECLARE @name NVARCHAR(30), @sql NVARCHAR(300)set @sql= N'SELECT TOP 1 @n=EmpName from dbo.Emp' exec ...
- cocos2d-x 添加纹理自动回收机制
转自:http://www.cnblogs.com/lancidie/archive/2013/04/13/3019375.html 1.不是一个完整的模块,所以不提供完整代码,只提供思路和核心代码. ...
- js冒泡事件示例
<html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>jQuery - Start ...
- careercup-C和C++ 13.7
13.7 写一个函数,其中一个参数是指向Node结构的指针,返回传入数据结构的一份完全拷贝. Node结构包含两个指针,指向另外两个Node. C++实现代码: typedef map<Node ...
- php开启新的进程或者线程
开启线程: $php_cli_path = '/usr/bin/php';$dir_path = dirname(__FILE__)."/".'CheckTaskState.she ...
- Html简单demo_html列表中进行编辑操作
html列表中进行编辑操作 <div class="_sort_box" style="float: left;"><?php echo $v ...
- 【转】C语言 字符数组与字符串
原文:http://blog.csdn.net/metasearch/article/details/2856097 在C语言编程中,当我们声明一个字符串数组的时候,常常需要把它初始化为空串.总结起来 ...
- windows7怎么共享文件夹
http://jingyan.baidu.com/article/d45ad148f06fef69552b80e6.html
- 如何查找局域网的外网ip
方法一:一个简单的方法 用你电脑打开www.ip138.com 就可以看到自己的公网IP地址 方法二:如果一定要从路由器里面看 那就打开路由的配置页面 一般在系统状态里面 会有个WAN口IP 那就是你 ...
- 如何去除掉inline-block元素之间的默认间距
前几天写一个页面 div{width:900px;} div li{ display:inline-block; width:300px;} <ul> <li></li& ...