关于T-SQL语言,下列说法正确的是句可以怎么分类?

T-SQLDDL:–进入某个数据库use TestBasego–创建表create table ProductInfos(Id int identity(1001,1) primary key not null,ProNo varchar(50) unique not null,ProName nvarchar(20) not null,TypleId int not null,foreign key references ProductType(TypeId),Price decimal(18,2) check (Price<10000) default(0.00) not null,ProCount int default (0) null,)go–删除表drop table ProductInfosgo–在建表完成后,创建约束Create table ProductInfos(Id int identity(1001,1) not null, --标识种子,–主键 Idalter table ProductInfos add constraintPK_ProductInfos primary key(Id)–外键 TypeIdalter table ProductInfos add constraintFK_ProductInfos foreign key (TypeId) referencesProductType(TypeId)–unique约束 ProNoAlter table ProductInfos add constraintIX_ProductInfos_ProNo unique(ProNo)–unique ProNo+ProNameAlter table ProductInfos add constraintIX_ProductInfos_ProNo unique (ProNo,ProName)–check 约束alter table ProductInfos add constraintCK_ProductInfos_Price check(Price<10000)–default 约束alter table ProductInfos add constraint DF_ProCountdefault (0) for ProCount<}

我要回帖

更多关于 关于T-SQL语言,下列说法正确的是 的文章

更多推荐

版权声明:文章内容来源于网络,版权归原作者所有,如有侵权请点击这里与我们联系,我们将及时删除。

点击添加站长微信