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 不同的数据类型的更多相关文章

  1. SQL Server常见数据类型介绍

    数据表是由多个列组成,创建表时必须明确每个列的数据类型,以下列举SQL Server常见数据类型的使用规则,方便查阅. 1.整数类型 int 存储范围是-2,147,483,648到2,147,483 ...

  2. hibernate中java类的成员变量类型如何映射到SQL中的数据类型变化

    hibernate映射文件??.hbm.xml配置映射元素详解--Hibernate映射类型 在从Hibernate的java的成员类型映射到SQL中的数据类型,其内映射方式它满足,SQL可以自己调制 ...

  3. Sql Server之数据类型详解

      数据类型是一种属性,用于指定对象可保存的数据的类型,SQL Server中支持多种数据类型,包括字符类型.数值类型以及日期类型等.数据类型相当于一个容器,容器的大小决定了装的东西的多少,将数据分为 ...

  4. SQL中sysname数据类型的含义(转)

    sysname SQL Server 实例包括用户定义的名为 sysname 的数据类型.sysname 用于表列.变量以及用于存储对象名的存储过程参数.sysname 的精确定义与标识符规则相关:因 ...

  5. SQL Server 常见数据类型介绍

    数据表是由多个列组成,创建表时必须明确每个列的数据类型,以下列举SQL Server常见数据类型的使用规则,方便查阅. 整数类型 int 存储范围是-2,147,483,648到2,147,483,6 ...

  6. 说说SQL Server的数据类型

    以SQL Server为例,SQL Server的数据类型总共有33种,归纳为一下类别: 精确数字 Unicode字符串 近似数字 二进制字符串 日期和时间 其他数据类型 字符串   1.数字数据类型 ...

  7. SQL SERVER的数据类型

    1.SQL SERVER的数据类型 数据类弄是数据的一种属性,表示数据所表示信息的类型.任何一种计算机语言都定义了自己的数据类型.当然,不同的程序语言都具有不同的特点,所定义的数据类型的各类和名称都或 ...

  8. sql server 字符数据类型

    SQL Server 中字符类型包括varchar.char.text等.主要用于存储字符数据.varchar和char类型的主要区别在于数据填充.例如,一个列名为FirstName且数据类型为var ...

  9. Caused by: java.sql.SQLSyntaxErrorException: ORA-00932: 数据类型不一致: 应为 NUMBER, 但却获得 BINARY

    at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvo ...

随机推荐

  1. maven快速入门

    一.maven maven可以说是管理项目的优秀工具,管理jar包 二.mave安装 1.先安装jdk(本文不详细讲) 2.安装maven ①.maven下载   http://maven.apach ...

  2. 60款开源云应用【Part 2】(60 Open Source Apps You Can Use in the Cloud)

    60款开源云应用[Part 2](60 Open Source Apps You Can Use in the Cloud) 本篇翻译自http://www.datamation.com/open-s ...

  3. EXE文件结构及读取方法

    一.EXE文件概念 EXE File英文全名executable file ,译作可运行文件,可移植可运行 (PE) 文件格式的文件,它能够载入到内存中,并由操作系统载入程序运行.是可在操作系统存储空 ...

  4. VRRP协议具体解释

    转帖:http://blog.chinaunix.net/space.php?uid=11654074&do=blog&id=2857384 Contents              ...

  5. jdbc_连接数据库

    1.例一: package com.vince.jdbc; import java.sql.Connection;import java.sql.DriverManager;import java.s ...

  6. boot2docker安装及使用

    更新homebrew 为了确保有boot2docker的安装脚本 brew update 安装boot2docker brew install boot2docker 初始化 boot2docker ...

  7. JAVA白盒安全测试需要关注的API

    JAVA白盒安全测试需要关注的APIhttp://blog.csdn.net/testing_is_believing/article/details/19502167

  8. CI框架中自定义view文件夹位置

    要想自定义view文件夹的位置,首先要了解CI框架时如何加载view文件夹的. CI中默认调用view的方法是: $this->load->view(); //这一行代码的原理是什么呢?请 ...

  9. Azure PowerShell 创建虚拟机

    # 指定订阅名称$subscriptionName="订阅名称"# 指定云服务名称$serviceName="云服务名称"# 指定用来保存虚拟机VHD的存储$s ...

  10. linux解压命令笔记

    转载:http://www.cnblogs.com/eoiioe/archive/2008/09/20/1294681.html .tar 解包:tar xvf FileName.tar打包:tar ...