sql判断数据库类型数据_SQL数据类型

sql判断数据库类型数据

SQL | 资料类型 (SQL | Data Types)

Just like other programming languages, facilities of defining data of various types are available in SQL also. SQL supports the following data types for the specification of various data-items or fields of a relation/table. In SQL, each column of the table is assigned a datatype which conveys the kind of value that will be stored in the column.

与其他编程语言一样, SQL中也提供了用于定义各种类型的数据的功能。 SQL支持以下数据类型来指定关系/表的各种数据项或字段。 在SQL中,表的每一列都分配有一种数据类型,该数据类型传达将存储在该列中的值的类型。

SQL数据类型的类型 (Types of SQL Data Types)

  1. Numeric data type:

    数值数据类型

    It includes datatypes like

    它包括类似的数据类型

    int, tinyint, bigint, float, real, etc.

    int , tinyint , bigint , float , real等。

  2. Date and Time data type:

    日期和时间数据类型

    It includes datatypes like

    它包括类似的数据类型

    Date, Time, Datetime, etc.

    日期 , 时间 , 日期时间等等

  3. Character and String datatype:

    字符和字符串数据类型

    It includes data types like

    它包括类似的数据类型

    char, varchar, text, etc.

    char , varchar , text等。

  4. Unicode character/string datatypes:

    Unicode字符/字符串数据类型

    It includes datatypes like

    它包括类似的数据类型

    nchar, nvarchar, ntext, etc.

    nchar , nvarchar , ntext等。

  5. Binary datatype:

    二进制数据类型

    It includes datatypes like

    它包括类似的数据类型

    binary, varbinary, etc.

    二进制 , varbinary等

  6. Miscellaneous datatype:

    其他数据类型

    It includes datatypes like

    它包括类似的数据类型

    clob, blob, xml, cursor, table, etc.

    clob , blob , xml , 游标 , 表格等。

Many data types are discussed below...

下面讨论了许多数据类型...

整数(数字) (Integer(Numeric))

It stores/represents positive whole number up to 11 digits and negative whole numbers upto 10 digits. The range of integers is from -2,147,483,648 to 2,147,483,647.

它存储/表示最多11位数字的正整数和最多10位数字的负数。 整数的范围是-2,147,483,648至2,147,483,647。

Syntax:

句法:

    <INTEGER or integer>

小灵通 (SMALLINT)

It is a 16-bit signed integer value that stores whole numbers in the range from -32768 to 32767. Its width is up to 5 digits.

它是一个16位带符号整数值,存储从-32768到32767范围内的整数。 宽度最大为5位数字。

Syntax:

句法:

    <SMALLINT>

数字 (NUMERIC)

Numbers are stored in the given format, where x is the total number of digits and y is the number of places to the right of the decimal point. x must include an extra place for the decimal point.

数字以给定的格式存储,其中x是数字的总数,y是小数点右边的位数。 x必须在小数点后包含一个额外的位置。

Syntax:

句法:

    <NUMERIC(x,y)>

Example:

例:

    Numeric(8,2)

In the given example, numeric datatype stores a number that has 5 places before the decimal and 2 digits after the decimal and 1 digit place for the decimal point. Numeric holds up to 20 significant digits. A negative number holds one place for the sign, i.e.,(-)

在给定的示例中,数字数据类型存储一个数字,该数字在小数点前5位,小数点后2位,小数点后1位。 数字最多包含20个有效数字。 负数在符号处占一位,即( - )

十进制 (DECIMAL)

Numbers are stored in the DECIMAL format, where x is the size,i.e., the total number of digits and y is precision, i.e., the number of places to the right of the decimal point.

数字以DECIMAL格式存储,其中x是大小,即总位数,y是精度,即小数点右边的位数。

Syntax:

句法:

    <DECIMAL(x,y) or DECIMAL(size,precision)>

Example:

例:

    Decimal(8,2)

In the above example, decimal datatype stores a number that has 5 digits before the decimal and 2 digits after the decimal and 1 digit place for the decimal. Decimal holds up to 19 significant digits. A negative number uses one place for its sign(-).

在上面的示例中,十进制数据类型存储一个数字,该数字在小数点前5位,小数点后2位,小数点后1位。 十进制最多可包含19个有效数字。 负数的符号(-)使用一个位。

字符(固定长度) (CHARACTER(fixed length))

This data type stores 'x' number of characters in the string. A maximum of 254 characters can be stored in a string. x or size is the number of characters to store which is of fixed length, to the number of characters specified. If you store strings that are not as long as the 'size' or 'x' parameter value, the remaining spaces are left unused.

此数据类型在字符串中存储' x '个字符。 一个字符串中最多可以存储254个字符。 x或size是要存储的字符数,其固定长度为指定字符数。 如果存储的字符串的长度不超过' size '或' x '参数值,则剩余的空格将保持闲置状态。

Syntax:

句法:

    <CHAR(x) or CHAR(size)>

Example:

例:

if you specify CHAR (10), strings such as "ram" and "technology" are each stored as 10 characters. However, a student admission_no is 6 digits long in a school, so CHAR(6) would be appropriate to store the admission_no of all the students. This data type is suitable where the number of characters to store is fixed. The values for CHAR data type have to be enclosed in single or double quotation marks.

如果指定CHAR(10) ,则诸如“ ram”“ technology”之类的字符串均存储为10个字符。 但是,学生的入学号在学校中为6位数字,因此CHAR(6)适合存储所有学生的入学号 。 此数据类型适用于要存储的字符数固定的情况。 CHAR数据类型的值必须用单引号或双引号引起来。

字符(可变长度) (CHARACTER (variable length))

This data type is used to store variable-length alphanumeric data.

此数据类型用于存储长度可变的字母数字数据。

Syntax:

句法:

    <VARCHAR(x) or VARCHAR2(x)>

Example:

例:

The address of a student can be declared as VARCHAR (25) to store the address up to 25 characters long. The advantage of using this data type is that VARCHAR will not leave unused spaces. It releases the unused memory spaces.

可以将学生的地址声明为VARCHAR(25),以存储最多25个字符的地址。 使用此数据类型的优点是VARCHAR不会留下未使用的空间。 释放未使用的内存空间。

日期 (DATE)

This data type is used to store a date in 'yyyy/mm/dd' format. It stores a year, month and date values. DATE values can be compared with each other only. The date decimal point values to be entered are to be enclosed in { } or with single quotation marks.

此数据类型用于以' yyyy / mm / dd '格式存储日期。 它存储年,月和日期值。 DATE值只能相互比较。 要输入的日期小数点值将用{}括起来或用单引号引起来

Syntax:

句法:

    <DATE>

时间 (TIME)

This data type is used to store time in hh:mm:ss format. It stores hour, minute, and second values.

此数据类型用于以hh:mm:ss格式存储时间。 它存储小时,分钟和秒值。

Syntax:

句法:

    <TIME>

For Example, a time of day can be taken as 12:30:45 p.m. where 12 means hours, 30 means minutes and 45 means seconds.

例如 ,一天中的某个时间可以设为12:30:45 pm,其中12表示小时,30表示分钟,45表示秒。

BOOLEAN(逻辑) (BOOLEAN (logical))

This data type is used for storing logical values, either true or false. In both upper and lower case, T or Y stands for logical true and F or N stands for logical false. The fields with Boolean (logical) datatype can be compared only to other logical columns or constants.

此数据类型用于存储逻辑值truefalse 。 在大写和小写形式中, TY代表逻辑trueFN代表逻辑false 。 具有布尔(逻辑)数据类型的字段只能与其他逻辑列或常量进行比较。

Syntax:

句法:

    <BOOLEAN>

BLOB / RAW /长RAW (BLOB/RAW/LONG RAW)

This data type can store data up to a maximum length of 65535 characters. BLOBs are "Binary Large Objects" and are used to store large amounts of data, such as images, animations, clips or other types of files.

此数据类型最多可存储65535个字符的数据BLOB是“ 二进制大对象 ”,用于存储大量数据,例如图像,动画,剪辑或其他类型的文件。

Syntax:

句法:

    <BLOB or RAW or LONG RAW>

For Example, image raw(2000);

例如 image raw(2000);

备忘/长 (MEMO/LONG)

This datatype allows storing characters or remarks upto 2 GB per second.

此数据类型允许每秒最多存储2 GB的字符或注释。

Syntax:

句法:

    <MEMO or LONG>

翻译自: https://www.includehelp.com/sql/data-types.aspx

sql判断数据库类型数据

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/543717.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

同事反馈环:如何实现持续改进的文化

“魔镜魔镜告诉我&#xff0c;谁才是最美丽的人&#xff1f;”&#xff0c;邪恶的皇后如此问道。似乎在精益和敏捷企业中也会有很多与《白雪公主》中类似的问题&#xff0c;如果我们没有一面可以看到我们正在做什么的镜子&#xff0c;我们就很难搞清楚我们有多么美丽&#xff0…

Scala懒惰瓦尔

Scala | 懒惰的瓦尔 (Scala | lazy val) Scala programming language allows the user to initialize a variable as a lazy val. A lazy variable is used when we need to save memory overheads while object creation. Using the lazy keyword, you can halt the initializ…

经典功率谱估计及Matlab仿真

原文出自&#xff1a;http://www.cnblogs.com/jacklu/p/5140913.html 功率谱估计在分析平稳各态遍历随机信号频率成分领域被广泛使用&#xff0c;并且已被成功应用到雷达信号处理、故障诊断等实际工程中。本文给出了经典功率谱估计的几类方法&#xff0c;并通过Matlab的实验仿真…

ruby 三目运算符_Ruby运算符

ruby 三目运算符Ruby运算符 (Ruby operators) Operators are the symbols which assist compiler or interpreter to carry out certain mathematical, logical and relational tasks and produce the results. Operators are method calls with parameters. 运算符是帮助编译器…

极验验证码流程-3.图片加密处理 图片移位

终于把图片加密给搞定了&#xff0c;原理是他把图分成了52个部分&#xff0c;然后通过移动来形成新的图片 主要的位置关系看代码 顺便吐槽下ruby,小众语言就是这么不方便&#xff0c;很多库都没有&#xff0c;百度了半天 最后换成了java来写 图片保存到本地的就不详细说了 主要…

什么是Brouter?

代理&#xff1a;网络设备 (Brouter: A network device) Brouter is a network device, which operates as a combination of both bridge and router. In this single device, a user will get a function of both bridge and router, as it can send out data to create a co…

11gR2 RAC时间同异常导致节点down掉问题处理

实验环境下11204的RAC环境&#xff0c;出现了一个节点DOWN掉的问题。检查日志信息后&#xff0c;在otcssd日志信息发现如下信息&#xff1a;2016-01-17 23:15:20.564: [ CTSS][1175029504]ctsscomm_recv_cb2: Receive incoming message event. Msgtype [3].2016-01-17 23:15…

html-iframe_HTML iframe

html-iframeiframe (Iframes) In HTML, iframes are used to display a webpage inside another webpage. 在HTML中&#xff0c; iframe用于在另一个网页内显示一个网页。 Syntax: 句法&#xff1a; <iframe src"URL"></iframe>The <iframe> tag…

ruby循环_Ruby循环

ruby循环Ruby循环 (Ruby Loops) Loops are comprised of sequentially group instructions which are executed repeatedly until a certain condition is met. Loops provide great help in making the programmers task easier. 循环由顺序执行的组指令组成&#xff0c;这些指…

后缀数组 TYVJ P1860 后缀数组

/*P1860 后缀数组时间: 1000ms / 空间: 131072KiB / Java类名: Main描述 我们定义一个字符串的后缀suffix(i)表示从s[i]到s[length(s)]这段子串。后缀数组&#xff08;Suffix array&#xff09;SA[i]中存放着一个排列&#xff0c;满足suffix(sa[i])<suffix(sa[i1]) 按照字典…

Binary XML file line #2: You must supply a layout_height attribute inflate

Android开发中遇到的奇葩问题之一&#xff1a;java.lang.NullPointerException&#xff0c;java.lang.RuntimeException:Binary XML file line #2: You must supply a layout_height attribute inflate&#xff0c;遇到这个问题说明你在非主流上测试&#xff0c;或者说是在部分…

量词逻辑量词里面的v表示?_知识表示能力问答中的人工智能量词(MCQ)

量词逻辑量词里面的v表示&#xff1f;1) How many types of quantifiers are there that are used to represent knowledge? 3 types2 typesUser can define as many quantifiers he wantsNone of the above Answer & Explanation Correct answer: 22 types There are two…

给定数组A []和数字X,请检查A []中是否有对X | 使用两个指针算法,O(1)空间复杂度| 套装2...

Prerequisite: 先决条件&#xff1a; Hashing data structure 散列数据结构 Given an array A[] and number X, check for pair in A[] with sum X | using hashing O(n) time complexity | Set 1 给定数组A []和数字X&#xff0c;请检查A []中是否有对X | 使用哈希O(n)时间复…

集合操作(三)Set

2019独角兽企业重金招聘Python工程师标准>>> Set集合 HashSet 哈希表保证元素的唯一性依赖于两个方法一个是hashCode方法一个是equals方法 如果两个对象的hashCode值相同,并且调用该对象的equals方法返回的是true的时候,那么就说明两个对象是相同的 结论&#xff1a…

mcq 队列_MCQ | 软件程序分析工具和组件分类| 免费和开源软件

mcq 队列Q1. Which of the following analysis methods come under Static Analysis Tools? Q1。 静态分析工具包含以下哪些分析方法&#xff1f; Code Walkthrough 代码演练 Code Inspection 代码检查 None of the Above 以上都不是 Both a. & b. 两者都 &#xff06;b。…

samba部署小结

[rootOracle ~]# yum install samba-swat -y[rootOracle ~]# yum install samba-client 客户端工具主配置文件&#xff1a;[rootOracle ~]# cat /etc/samba/smb.conf |grep -v "#"|grep -v "^$"|grep -v ";"[global]workgroup …

JAVA调用动态链接库

上一篇《JAVA本地接口&#xff08;JNI&#xff09;》中介绍了JAVA的JNI技术&#xff0c;通过JAVA自有的方式调用动态链接库&#xff0c;这一篇将继续为大家介绍使用其他方式调用动态链接库。 首先&#xff0c;我们编写一个用于测试的链接库 头文件 print.h #ifdef DLL_IMPLEME…

数组重复次数最多的元素递归_在不使用递归的情况下计算链接列表中元素的出现次数...

数组重复次数最多的元素递归Solution: 解&#xff1a; Input: 输入&#xff1a; A singly linked list whose address of the first node is stored in a pointer, say head and key is the data of which we have to count the number of occurrences. 一个单链表 &#xff…

DshanMCU-R128s2芯片外设支持列表

LCD 显示屏 厂商分辨率型号接口FPS100ask480 x 320Dshan_Display ModuleSPI60 摄像头 Sensor 厂商分辨率型号Size接口FPSGalaxyCoreVGA, 640 x 480GC03081/6.5DVP30GalaxyCoreUXGA, 1616 x 1232GC21451/5DVP13

第6周 搜索与排序

1 查找里程 给你这样一张里程表&#xff0c;如何写一个程序&#xff0c;输入两地的地名&#xff0c;能输出期间的里程&#xff1f; #include <stdio.h> #include <string.h> #define C_LEN 30typedef struct city {char name1[C_LEN];char name2[C_LEN];int distan…