当前位置:网站首页>SQL data type
SQL data type
2022-04-22 09:41:00 【I just learned programming】
SQL A data type is an attribute , It specifies anything SQL The type of data in the object . stay SQL in , Any column 、 Variables or expressions have their data types .
When creating a table , You will use these data types . You should choose the appropriate data type for each column in the table as needed .
SQL Server Six data types are provided for you to use :
Exact numeric data type
| data type | Lower limit | ceiling |
| bigint | -9,223,372,036,854,770,000 | 9,223,372,036,854,770,000 |
| int | -2,147,483,648 | 2,147,483,647 |
| smallint | -32,768 | 32,767 |
| tinyint | 0 | 255 |
| bit | 0 | 1 |
| decimal | 1E+38 | 10^38 -1 |
| numeric | 1E+38 | 10^38 -1 |
| money | -922,337,203,685,477.00 | 922,337,203,685,477.00 |
| smallmoney | -214,748.36 | 214,748.36 |
Approximate numerical data type
| data type | Lower limit | ceiling |
| float | -1.79E + 308 | 1.79E + 308 |
| real | -3.40E + 38 | 3.40E + 38 |
Date and time data types
| data type | Lower limit | ceiling |
| datetime | Jan 1, 1753 | 31-Dec-99 |
| smalldatetime | 1-Jan-00 | 6-Jun-79 |
| date | Store a date data , for example June 30, 1991 | |
| time | Store a time data , for example 12:30 P.M. |
Be careful :datetime The time and accuracy are 3.33 ms, and smalldatetime The time accuracy of is 1 min.
String data type
| data type | Lower limit | ceiling |
| char | char | Maximum length is 8,000 character .( Fixed length is not Unicode character ) |
| varchar | varchar | Maximum length is 8,000 character .( Lengthening is not Unicode data ) |
| varchar(max) | varchar(max) | Maximum length is 231 character , Lengthening is not Unicode data ( Limited to SQL Server 2005). |
| text | text | Lengthening is not Unicode Character data , Maximum length 2,147,483,647 character . |
Unicode String data type
| data type | describe |
| nchar | Maximum length 4000 character .( Fixed length Unicode character string ) |
| nvarchar | Maximum length 4000 character .( Lengthening Unicode character string ) |
| nvarchar(max) | Maximum length 231 character .( Limited to SQL Server 2005).( Lengthening Unicode character string ) |
| ntext | Maximum length 1,073,741,823 character .( Lengthening Unicode character string ) |
Binary data type
| data type | describe |
| binary | Maximum length 8000 byte .( Fixed length binary data ) |
| varbinary | Maximum length 8000 byte .( Variable length binary data ) |
| varbinary(max) | Maximum length 231 byte ( Limited to SQLServer 2005). ( Variable length binary data ) |
| image | Maximum length 2,147,483,647 byte .( Variable length binary data ) |
Other data types
| data type | describe |
| sql_variant | Store a variety of SQL Supported data types ,text、ntext、timestamp With the exception of . |
| timestamp | A unique value at the database level , This data is updated whenever a row is updated . |
| uniqueidentifier | Globally unique identifier (GUID) |
| xml | Storage XML data . You can store... In columns or variables XML example .( Limited to SQL Server 2005) |
| cursor | Point to cursor object . |
| table | Store results , For later use . |
版权声明
本文为[I just learned programming]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204220932544711.html
边栏推荐
猜你喜欢

P型MOS管开关电路及工作原理详解-KIA MOS管

Command ‘yum‘ not found, but can be installed with: apt install yum

问题解决:dpkg-deb: error: package name has characters that aren‘t lowercase alphanums or ‘-+.‘

Transform based deep learning target detection (Detr model)

超越 iTerm!号称下一代 Terminal 终端神器,用完爱不释手!

Zhezheng nail scanning code login

内存管理-

VLAN——虚拟局域网概述

Heap overflow of kernel PWN basic tutorial

三极管、场效应管和MOS管三者的工作原理
随机推荐
Sorting and publishing of remote sensing image segmentation data set
MySQL多实例安装方法一
Analysis of the factors affecting the switching speed of MOS transistor Kia MOS transistor
source_insight新建工程以及在整个文档中搜索某个变量或者函数的方法
Beyond iterm! Known as the next generation terminal artifact, powerful!
Easy to use screenshot software
作文以记之 ~ 目标和
拜登宣布再向乌克兰提供8亿美元安全援助
SQL 关系型数据库管理系统
Write a simple examination program to complete the interaction of questions and answers on the console. Questions are divided into single choice and multi choice.
How to select Bi tools? These three questions are the key
超越iTerm! 号称下一代终端神器,功能贼强大!
DA14580BLE点亮LED
Quantitative investment learning -- Introduction to orderflow
LC301. Remove invalid parentheses
SQL 创建数据库
2022起重机司机(限桥式起重机)考试题库及在线模拟考试
加密压缩备份BAT脚本
QT event filter instance
Implementation and analysis of watchablestore in etcd