国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 開發 > 綜合 > 正文

數據庫系列學習(十)-約束

2024-07-21 02:46:04
字體:
來源:轉載
供稿:網友
數據庫系列學習(十)-約束
1.主鍵約束(PRimary key)
create table T_User1(        Id int primary key identity(1,1),    UName nvarchar(10))
2.非空約束(not null)create table T_User2(    Id int primary key identity(1,1),    UName nvarchar(10) not null)3.1唯一約束(unique)-單列create table T_User3(    Id int primary key identity(1,1),    UNo nvarchar(10)unique)3.2唯一約束-多列create table T_User4(    Id int primary key identity(1,1),    UAddress nvarchar(10),    UName nvarchar(10),    constraint uniq_addr_name unique(UAddress,UName))4.1Check約束(check)-單列create table T_User5(    Id int primary key identity(1,1),    UName nvarchar(10)check(len(UName)<4),    UAge int check(UAge>0))4.2Check約束-多列create table T_User6(    Id int primary key identity(1,1),    UWorkYear int,    UAge int,    constraint ck_wkyear_age check(UWorkYear<UAge))5.外鍵約束(foreign key)create table T_Author(    AId int primary key identity(1,1),    AName nvarchar(10))create table T_Blog(    BId int primary key identity(1,1),    BAuthorId int,    foreign key(BAuthorId) references T_Author(AId))

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 如皋市| 沭阳县| 祁东县| 淮阳县| 洛隆县| 吴桥县| 黎城县| 碌曲县| 文昌市| 洪江市| 吉林省| 进贤县| 三亚市| 桓仁| 东至县| 嘉峪关市| 新宁县| 黄平县| 游戏| 广灵县| 锦州市| 泗阳县| 正定县| 奉贤区| 永安市| 云和县| 正定县| 惠州市| 缙云县| 阿克陶县| 定结县| 荥阳市| 鹿泉市| 浦江县| 礼泉县| 康马县| 云浮市| 嘉义县| 丹凤县| 株洲县| 繁昌县|