当前位置:网站首页>Sql Server 数据库之数据类型
Sql Server 数据库之数据类型
2022-07-26 10:40:00 【孩纸D】
数据库的类型大致分为三种:数字数据类型、字符数据类型、日期和时间数据类型。
一、数字型
我记录的是几种比较常用的,并不完整
| 整数类型 | bigint | - ~ -1 |
| int | - ~ -1 | |
| bit | 1 or 0 | |
| 小数类型 | decimal | 这两个用法是一样的,几乎没有差别,numeric(52,1)这样表示总长度为52,其中小数位有1位。后面也可以不加,或者只加一个数字表示总长度(没有小数位) |
| numeric | ||
| float | 最常用的还是float | |
| 货币类型 | money | 精确到货币单位的千分之十,不过一般直接用float表示就可以了 |
二、字符数据类型
| 单字节(8000) | varchar() | 变长,最多可储存的字节数 | 牺牲了性能(每次要进行判断),节省了空间 | 常用varchar()类型 |
| char() | 定长,储存空间直接分配好 | 浪费了空间,提升了性能 | ||
| 双字节(4000) | nvarchar() | 变长 | 常用nvarchar()类型 | |
| nchar() | 定长 | |||
| 一个英文字母占一个字节,一个汉字占两个字节 | ||||
三、日期和时间数据类型
| datetime | 精确到毫秒 |
| smalldatetime | 精确到分钟 |
| 一般日期也可以用字符型varchar()来表示的。 | |
边栏推荐
- RT-Thread 学习笔记(八)---开启基于SPI Flash的elmfat文件系统(下)
- Tradingview tutorial
- Constructors, method overloads, object arrays, and static
- What if MySQL can't get in
- 【机器学习小记】【风格迁移】deeplearning.ai course4 4th week programming(tensorflow2)
- Koin
- [paper after dinner] deep mining external perfect data for chestx ray disease screening
- STM32 Alibaba cloud mqtt esp8266 at command
- 回到顶部的几种方案(js)
- 2021-08-14三子棋
猜你喜欢

The problem of large fluctuation of hx711 data

在神州IV开发板上成功移植STemWin V5.22

第4期:大学生提前职业技能准备之一
![[machine learning notes] [face recognition] deeplearning ai course4 4th week programming](/img/7e/9c0e88097b90c0c24ebf86f090805b.png)
[machine learning notes] [face recognition] deeplearning ai course4 4th week programming

【机器学习小记】【风格迁移】deeplearning.ai course4 4th week programming(tensorflow2)
![[leetcode daily question 2021/8/30]528. Choose randomly by weight [medium]](/img/13/c6cb176d7065035f60d55ad20ed1bf.png)
[leetcode daily question 2021/8/30]528. Choose randomly by weight [medium]

mysql20210906

反射机制简述

Centos8 (liunx) deploying WTM (asp.net 5) using PgSQL

多目标优化系列1---NSGA2的非支配排序函数的讲解
随机推荐
Navicat15 MySQL (centos7) connected to local virtual machine
使用grid实现左中右布局,中间内容自适应
algorithm
在altium designer中禁用USBJATG
.net operation redis string string
Build ARM embedded development environment
异常的概念与处理
RT-Thread 学习笔记(三)---用SCons 构建编译环境
点击el-dropdown-item/@click.native
[leetcode每日一题2021/8/30]528. 按权重随机选择【中等】
13 以对象管理资源
RT-Thread 学习笔记(七)---开启基于SPI Flash的elmfat文件系统(中)
RT-Thread 学习笔记(八)---开启基于SPI Flash的elmfat文件系统(下)
工厂模式详解
[notes on machine learning] [building a cyclic neural network and its application] deeplearning ai course5 1st week programming(keras)
STM32 Alibaba cloud mqtt esp8266 at command
Flutter 防止科学计数并去除尾数无效0
10 let operator= return a reference to *this
比较器(Comparable与Comparator接口)
px2rem-loader将px转化为rem,适配移动端vant-UI等框架
~
~