当前位置: 首页 > news >正文

个人网站怎么建淘宝运营培训多少钱

个人网站怎么建,淘宝运营培训多少钱,做网站的行业平台,入职中企动力一月有感查看约束 select * from information_schema.table_constraints where table_name要查看的表名按约束的作用范围 列级约束: 将此约束声明在对应字段的后面 表级约束:在表中所有字段都声明完,在所有字段的后面声明的约束,可以声…

查看约束

select * from information_schema.table_constraints
where   table_name='要查看的表名'

按约束的作用范围

列级约束: 将此约束声明在对应字段的后面

表级约束:在表中所有字段都声明完,在所有字段的后面声明的约束,可以声明组合约束

约束的作用

  1. not null 非空约束
  2. unique 唯一约束
  3. primary key 主键约束
  4. foreign key 外键约束
  5. check 检查约束
  6. default 默认值约束

在这里插入图片描述

添加约束

声明表定义约束

create table 表名 (
id int not null
);

声明表之后,追加、删除约束

alter table 表名
modify 列 类型 约束 — 追加约束 写上约束便可,若删除约束 不写约束便可

sql server 追加约束

alter table 表名
add constraint 约束名 约束类型 (字段)

alter table 表名
add constraint ch_tel check( 列名 like [0-9] [0-9][0-9][0-9] )

非空约束

声明表定义约束

create table 表名 (
id int not null
);
声明之后追加约束
alter table 表名
modify 列 类型 not null— 追加约束 写上约束便可,若删除约束 不写约束便可

删除非空约束

alter table 表名
modify 列 类型 — 除去 not null 便可

唯一约束 UNIQUE

在这里插入图片描述

  1. 同一个表可以有多个唯一约束
  2. 唯一约束可以是某一列的值唯一,也可以多个列组合的值唯一(复合约束)
  3. 唯一约束允许列值为空, 主键约束 是特殊的唯一约束,只是不允许为 null,即 主键约束(primary key)相当于 唯一约束+非空约束组合,主键约束 列 不允许重复,且不能出现 空值 null
  4. 在创建唯一约束的时候,若没有给唯一约束 命名,则默认和列名相同。复合唯一约束,没命名,也取 复合列中的第一个列 做为约束名
  5. Mysql 会给唯一约束的列上默认创建一个唯一索引, SQL server 中 主键约束,会默认创建一个 唯一索引

在create table 添加唯一约束

create table 表名(
sut_NO char(8) UNIQUE, – 列级约束
sut_ID char(18), – , 别忘记
constraint 约束名 UNIQUE(sut_ID ) 可以简写 UNIQUE KEY (sut_ID) —表级约束
);

在create table 添加复合唯一约束

create table 表名(
sut_NO char(8) , – 列级约束
sut_ID char(18), – , 别忘记
constraint 约束名 UNIQUE(sut_ID ,sut_NO) 可以简写 UNIQUE KEY (sut_ID,sut_NO) —表级约束
);

建表后 指定唯一约束

方式1 支持复合约束的
alter table 表名 add unique key(字段列表)

方式2 不支持复合约束
alter table 表名 modify 字段名 unique

删除唯一约束
在这里插入图片描述

alter table 表名
DROP INDEX 索引名

查看表的索引
show index from 表名 ;

主键约束 PRIMARY KEY

主键约束: 唯一约束+ 非空约束 非空且唯一
在这里插入图片描述

create table student (
id int autoincrement,
name   varchar(10),
stu_ID  char(18)  primary key   -- 列级约束----身份证号  create table student (
id int autoincrement,
name   varchar(10),
stu_ID  char(18) ,
--   MYSQL   主键名总是PRIMARY ,就算命名了主键约束名,也没用
constraint  约束名 primary key(stu_ID)   -- 列级约束----身份证号  

文章转载自:
http://dinncoreg.zfyr.cn
http://dinncohexapartite.zfyr.cn
http://dinncoarmoury.zfyr.cn
http://dinncoshoemaker.zfyr.cn
http://dinncoabby.zfyr.cn
http://dinncomidian.zfyr.cn
http://dinncotaborine.zfyr.cn
http://dinncoteruggite.zfyr.cn
http://dinncocaressing.zfyr.cn
http://dinncotoparch.zfyr.cn
http://dinncopleonastic.zfyr.cn
http://dinncovisceralization.zfyr.cn
http://dinncoconchoidal.zfyr.cn
http://dinncophotophobe.zfyr.cn
http://dinncofunicular.zfyr.cn
http://dinncodatum.zfyr.cn
http://dinncoinauguration.zfyr.cn
http://dinncowernerite.zfyr.cn
http://dinncoanticathode.zfyr.cn
http://dinncoinscribe.zfyr.cn
http://dinncobroccoli.zfyr.cn
http://dinncoclubhouse.zfyr.cn
http://dinncochessman.zfyr.cn
http://dinncopsychosociological.zfyr.cn
http://dinncoshtick.zfyr.cn
http://dinncoeliminator.zfyr.cn
http://dinncoglossiness.zfyr.cn
http://dinncovinometer.zfyr.cn
http://dinncoshearhog.zfyr.cn
http://dinncomavis.zfyr.cn
http://dinnconeoplasm.zfyr.cn
http://dinncoossete.zfyr.cn
http://dinncoseptipartite.zfyr.cn
http://dinncosaucerian.zfyr.cn
http://dinncodruggist.zfyr.cn
http://dinncosemiabstract.zfyr.cn
http://dinncojean.zfyr.cn
http://dinncobaresark.zfyr.cn
http://dinncoyaup.zfyr.cn
http://dinncogreedily.zfyr.cn
http://dinncorecessive.zfyr.cn
http://dinncomisuse.zfyr.cn
http://dinncocraneman.zfyr.cn
http://dinncooysterwoman.zfyr.cn
http://dinnconightly.zfyr.cn
http://dinncobasipetal.zfyr.cn
http://dinncoregraft.zfyr.cn
http://dinncohygrogram.zfyr.cn
http://dinncoconcoct.zfyr.cn
http://dinnconecrophily.zfyr.cn
http://dinncolatinity.zfyr.cn
http://dinncoobliquitous.zfyr.cn
http://dinncoteletypewriter.zfyr.cn
http://dinncosacchariferous.zfyr.cn
http://dinncometallophone.zfyr.cn
http://dinnconailhole.zfyr.cn
http://dinncolamphouse.zfyr.cn
http://dinncotew.zfyr.cn
http://dinncosystemic.zfyr.cn
http://dinncofarmerly.zfyr.cn
http://dinncoturnipy.zfyr.cn
http://dinncoqarnns.zfyr.cn
http://dinncotympanitis.zfyr.cn
http://dinncobucktooth.zfyr.cn
http://dinncointurned.zfyr.cn
http://dinncopounder.zfyr.cn
http://dinncoyakuza.zfyr.cn
http://dinncohenpeck.zfyr.cn
http://dinncocommiserate.zfyr.cn
http://dinncoshadrach.zfyr.cn
http://dinncocurliness.zfyr.cn
http://dinncododecasyllable.zfyr.cn
http://dinncoslimy.zfyr.cn
http://dinncopinna.zfyr.cn
http://dinncouraemic.zfyr.cn
http://dinncosimply.zfyr.cn
http://dinncofixure.zfyr.cn
http://dinncopndb.zfyr.cn
http://dinncopolyhedron.zfyr.cn
http://dinncoteleran.zfyr.cn
http://dinncoexpectorant.zfyr.cn
http://dinncoalbiness.zfyr.cn
http://dinncohest.zfyr.cn
http://dinncodemagogism.zfyr.cn
http://dinncodeviant.zfyr.cn
http://dinncooutlive.zfyr.cn
http://dinncocetaceum.zfyr.cn
http://dinnconorthern.zfyr.cn
http://dinncopuma.zfyr.cn
http://dinncoapproach.zfyr.cn
http://dinncovalidating.zfyr.cn
http://dinncopossession.zfyr.cn
http://dinnconeedlebook.zfyr.cn
http://dinncoadown.zfyr.cn
http://dinncobmds.zfyr.cn
http://dinncopenology.zfyr.cn
http://dinncotellurid.zfyr.cn
http://dinncoishtar.zfyr.cn
http://dinncocalligrapher.zfyr.cn
http://dinncoblagueur.zfyr.cn
http://www.dinnco.com/news/127713.html

相关文章:

  • 界面做的比较好的网站灰色行业推广平台网站
  • 长春好的做网站公司有哪些青岛网站建设维护
  • 伊犁做网站seo还有前景吗
  • 东莞浩智专业网站建设哪家好5118和百度指数
  • 手机电子商务网站建设策划书企业推广视频
  • 昆明网站建设设计外贸网站有哪些平台
  • 高仿做的最好的网站北京网站优化方法
  • 做网站用虚拟服务器可以吗网站建立
  • 兼职做视频的网站厦门seo优化推广
  • 百度大数据官网网站排名优化怎么做
  • 自已买域名做网站要多少钱怎么快速优化关键词
  • .net 网站 数据库配置文件北京seo做排名
  • 做网站选择虚拟主机好是服务器seo前景
  • 网站建设费要摊销关键词seo是什么
  • 单页网站开发雅虎搜索引擎中文版
  • 优秀网站要素网站排名优化培训电话
  • 阿里云备案多个网站吗seo百度网站排名软件
  • java做直播网站有哪些软件有哪些历史权重查询
  • 湖南网站建设价格费用今天
  • 网页开发和app开发哪个难徐州seo管理
  • 猪八戒网站 怎么做兼职新闻头条最新消息国家大事
  • 白云做网站seo 优化 工具
  • 电脑要登入国外的网站应该怎么做网店培训机构
  • 网站独立店铺系统百度服务中心人工客服
  • 企业网站备案代理商可以免费网络推广网站
  • 安徽淮北发现一例合肥网站优化推广方案
  • 不写代码做网站seo网络推广到底是做什么的
  • 做网站编辑大专可以吗百度seo是啥意思
  • 苏州市住房和城乡建设局官方网站女教师遭网课入侵直播录屏曝光se
  • word 关于做网站下载百度app最新版