ASP.NET第七章 --案例1
创始人
2024-12-27 05:37:24
0

分两篇来分享

 

一、简单的数据库操作

1.登录SQL Server数据库

2.新建查询

3.代码部分如下

create database SqlQuery1          -- 创建SqlQuery1数据库  go  use SqlQuery1                     -- 操作SqlQuery1数据库  go  create table UserType             -- 创建第一张UserType数据表  (      Id int primary key identity(1,1),      -- 类别Id 主键 自增      TypeName nvarchar(40),                 -- 类别 区别:一个字符占varchar(2),只占nvarchar(1)  )  go  create table Users                     -- 创建第二张Users数据表  (      Id int primary key identity(1,1),      -- 用户Id 主键 自增      Name varchar(40) not null,             -- 用户姓名 非空      Sex bit not null,                     -- 用户性别 非空  bit:0,1,null 0为女,1为男,不选为null      Address nvarchar(60) not null,         -- 用户地址 非空      Phone varchar(40),                         -- 用户电话      Mail varchar(40),                     -- 用户邮箱      CardId int,      NickName nvarchar(60),      Pwd varchar(60) not null,              -- 用户密码      State int not null,      TypeId int not null foreign key    references UserType(Id)       -- 外键:foreign key   两个表连接references  )  go    --UserType表:铜牌会员,银牌会员,金牌会员  --Users表:三条数据 外键去添加主键的值,use1 use2 use3    insert into UserType values('铜牌会员')  go  insert into UserType values('银牌会员')  go  insert into UserType values('金牌会员')  go    -- 模拟查询  select * from UserType  go    --insert into Users values('use1','0','这是地址','这是电话','这是邮箱','1','NickName','123456','State','1')  --go  insert into Users values('use1','0','内蒙古','15024750806','846559951@qq.con','0','荣耀王者','123456','0','3')  go  insert into Users values('use2','1','河北','15024750806','846559951@qq.con','0','倔强青铜','789456','0','1')  go  insert into Users values('use3','1','北京','15024750806','846559951@qq.con','0','尊贵铂金','123456','0','2')  go    -- 模拟查询  select * from Users  go

 

4f32d4f29db4480bbfb5a8a4119d39e2.jpg

 

 

 

 

相关内容

热门资讯

透视模块!wpk作必弊(透视)... 透视模块!wpk作必弊(透视)开挂透视平台(哔哩哔哩)在进入wpk作必弊软件靠谱后,参与本局比赛的八...
透视模块!哈糖大菠萝怎么开挂(... 透视模块!哈糖大菠萝怎么开挂(透视)开挂透视神器(哔哩哔哩)运哈糖大菠萝怎么开挂辅助工具,进入游戏界...
透视教程书!如何下载德普之星辅... 透视教程书!如何下载德普之星辅助软件(透视)开挂脚本工具(哔哩哔哩)1、下载好如何下载德普之星辅助软...
透视操作!福建大菠萝万能辅助器... 透视操作!福建大菠萝万能辅助器(透视)开挂透视平台(哔哩哔哩)一、福建大菠萝万能辅助器可以开透视的定...
透视手段!德州hhpoker是... 透视手段!德州hhpoker是真的吗(透视)开挂透视软件(哔哩哔哩)1、用户打开应用后不用登录就可以...
透视项目!aapoker怎么控... 透视项目!aapoker怎么控制牌(透视)开挂透视修改器(哔哩哔哩)1、aapoker怎么控制牌免费...
透视秘籍!wepoker有透视... 透视秘籍!wepoker有透视功能吗(透视)开挂脚本平台(哔哩哔哩)wepoker有透视功能吗能透视...
透视阶段!hhpoker辅助挂... 透视阶段!hhpoker辅助挂(透视)开挂透视安装(哔哩哔哩)1、hhpoker辅助挂脚本辅助下载、...
透视手段!wpk可以作必弊吗(... 透视手段!wpk可以作必弊吗(透视)开挂透视安装(哔哩哔哩)1、首先打开wpk可以作必弊吗辅助器下载...
透视经验!wepoker底牌透... 透视经验!wepoker底牌透视(透视)开挂脚本平台(哔哩哔哩)一、wepoker底牌透视可以开透视...