ImageVerifierCode 换一换
格式:DOCX , 页数:16 ,大小:19.15KB ,
资源ID:6004356      下载积分:3 金币
快捷下载
登录下载
邮箱/手机:
温馨提示:
快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。 如填写123,账号就是123,密码也是123。
特别说明:
请自助下载,系统不会自动发送文件的哦; 如果您已付费,想二次下载,请登录后访问:我的下载记录
支付方式: 支付宝    微信支付   
验证码:   换一换

加入VIP,免费下载
 

温馨提示:由于个人手机设置不同,如果发现不能下载,请复制以下地址【https://www.bdocx.com/down/6004356.html】到电脑端继续下载(重复下载不扣费)。

已注册用户请登录:
账号:
密码:
验证码:   换一换
  忘记密码?
三方登录: 微信登录   QQ登录  

下载须知

1: 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。
2: 试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。
3: 文件的所有权益归上传用户所有。
4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
5. 本站仅提供交流平台,并不能对任何下载内容负责。
6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

版权提示 | 免责声明

本文(BBS源代码.docx)为本站会员(b****6)主动上传,冰豆网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知冰豆网(发送邮件至service@bdocx.com或直接QQ联系客服),我们立即给予删除!

BBS源代码.docx

1、BBS源代码-use mastergoif exists(select*from sysdatabases where name =BBS)drop database bbsgo-create database BBSon primary(name = BBS_data, -filename =d:BBS_data.mdf, -size = 20MB, -filegrowth=10%, -maxsize = 200MB -)log on(name =bbs_log, -filename =d:bbs_data.ldf, -size =10mb, -filegrowth = 10%,-maxsi

2、ze = 100MB -)use BBSgoif exists(select*from sysobjects where name =BBSUsers)drop table BBSUsersgocreate table BBSUsers(Uid int constraint pk_Uid primary key,-Uname char(8) not null, -UPassword char(16) constraint df_UPassword default 888888,-UEmail char(20) not null constraint ck_Uemail check(Uemail

3、 like%.%),-EMAILUBirthday datetime not null,-Usex int constraint df_Usex default 1, -UClass int constraint df_UClass default 1, -UStatement varchar(150)not null, -URegDate datetime not null default getdate(), -UState tinyint constraint df_UState default 1, - UPoint int constraint df_UPoint default 2

4、0 , - constraint ck_UPassword check(UPassword like _)if exists(select*from sysobjects where name =BBSTopic)drop table BBSTopicgocreate table BBSTopic(tid int constraint pk_tid primary key, -tsid int not null, -tuid int not null, -treplycount int not null, -temotion char(10) not null, -TTopic varchar

5、(16) not null CONSTRAINT ck_tt check(TTopic not like%), -TContents text not null, -TTime datetime not null default getdate() ,-TClickCount int not null, - TLastClickT datetime not null ,CONSTRAINT CK_TLC CHECK (TLastClickT=TTime) - )if exists(select*from sysobjects where name =BBSReply)drop table BB

6、SReplygocreate table BBSReply(RID int constraint pk_RID primary key,- RTID int,- RSID int,- RUID int,- REmotion char(10),- RTopic varchar(20),-RContents text,-RTime datetime default getdate(),-RClickCount int,-)if exists(select*from sysobjects where name =BBSSection)drop table BBSSectiongocreate tab

7、le BBSSection(SID int constraint pk_SID primary key,-SName char(10),- SMasterID int, - SStatement varchar(80), - SClickCount int constraint df_SClickCount default 0, - STopicCount int constraint df_STopicCount default 0 - )-alter table BBSTopicadd constraint fk1_BBSTopic_BBSUsers foreign key(tuid) r

8、eferences BBSUsers(Uid) -alter table BBSReplyadd constraint fk1_BBSReply_BBSTopic foreign key(RTID) references BBSTopic(TID) -alter table BBSReplyadd constraint fk1_BBSReply_BBSUsers foreign key(RUID) references BBSUsers(UID) -alter table BBSTopicadd constraint fk1_BBSTopic_BBSSection foreign key(ts

9、id) references BBSSection(Sid) -alter table BBSReplyadd constraint fk1_BBSReply_BBSSection foreign key(RSID) references BBSSection(Sid) -alter table BBSSectionadd constraint fk1_BBSSection_BBSUsers foreign key(SMasterID) references BBSUsers(Uid) -insertinto BBSUsers(uid,uname,upassword,uemail,UBirth

10、day,USex,UClass,UStatement,URegDate,UState,UPoint)values(1001 ,123456,1990,1990-12-12,1,ANGEL,2010-5-7,2,)insertinto BBSUsers(uid,uname,upassword,uemail,UBirthday,USex,UClass,UStatement,URegDate,UState,UPoint)values(1002 ,654321,1965,1980-7-1,2,ANGEL,2011-4-7,2,4)insertinto BBSUsers(uid,uname,upassw

11、ord,uemail,UBirthday,USex,UClass,UStatement,URegDate,UState,UPoint)values(1003 ,158664,conao,1997-1-03,2,ANGEL,2009-5-7,2,3)insertinto BBSUsers(uid,uname,upassword,uemail,UBirthday,USex,UClass,UStatement,URegDate,UState,UPoint)values(1004 ,175175,death,1992-1-4,1,ANGEL,2008-5-4,2,2)insertinto BBSUse

12、rs(uid,uname,upassword,uemail,UBirthday,USex,UClass,UStatement,URegDate,UState,UPoint)values(1005 ,198755,sgg,1994-1-4,1,ANGEL,2000-12-12,1,100)insertinto BBSUsers(uid,uname,upassword,uemail,UBirthday,USex,UClass,UStatement,URegDate,UState,UPoint)values(1006 ,192445,dsfg,1994-12-14,2,fdfs,2000-12-12

13、,1,97)-Sectioninsertinto BBSSection(SID,SName,SMasterID,SStatement,SClickCount,STopicCount)values(01 ,1006,5,5)insertinto BBSSection(SID,SName,SMasterID,SStatement,SClickCount,STopicCount)values(02 ,1005,4,5)-topicinsertinto BBSTopic(tid,TSID,TUID,TReplyCount,TEmotion,TTopic,TContents ,TTime,TClickC

14、ount,TLastClickT)values(2001 ,01,1006,1,.,DEVIL MAY CRY,2011-1-10,5,2011-6-24)insertinto BBSTopic(tid,TSID,TUID,TReplyCount,TEmotion,TTopic,TContents ,TTime,TClickCount,TLastClickT)values(2002 ,01,1006,0,.,DEVIL MAY CRY,2011-4-10,4,2011-6-28)insertinto BBSTopic(tid,TSID,TUID,TReplyCount,TEmotion,TTo

15、pic,TContents ,TTime,TClickCount,TLastClickT)values(2003 ,01,1006,1,.,1,DEVIL MAY CRY,2011-1-10,3,2011-6-27)insertinto BBSTopic(tid,TSID,TUID,TReplyCount,TEmotion,TTopic,TContents ,TTime,TClickCount,TLastClickT)values(2004 ,01,1006,0,.,2,DEVIL MAY CRY,2011-1-10,2,2011-6-26)insertinto BBSTopic(tid,TS

16、ID,TUID,TReplyCount,TEmotion,TTopic,TContents ,TTime,TClickCount,TLastClickT)values(2005 ,01,1006,1,.,3,DEVIL MAY CRY,2011-4-10,1,2011-6-24)insertinto BBSTopic(tid,TSID,TUID,TReplyCount,TEmotion,TTopic,TContents ,TTime,TClickCount,TLastClickT)values(2011 ,02,1001,1,.,2011-1-11,6,2011-6-29)insertinto

17、 BBSTopic(tid,TSID,TUID,TReplyCount,TEmotion,TTopic,TContents ,TTime,TClickCount,TLastClickT)values(2012 ,02,1002,0,.,DN,2011-1-11,7,2011-6-23)insertinto BBSTopic(tid,TSID,TUID,TReplyCount,TEmotion,TTopic,TContents ,TTime,TClickCount,TLastClickT)values(2013,02,1003,0,.,2011-2-11,8,2011-6-23)insertin

18、to BBSTopic(tid,TSID,TUID,TReplyCount,TEmotion,TTopic,TContents ,TTime,TClickCount,TLastClickT)values(2014 ,02,1004,0,.,2011-1-21,1,2011-6-11)-replyinsertinto BBSReply(RID,RTID,RSID,RUID,REmotion,RTopic,RContents,RTime,RClickCount)values(9001 ,2001,01,1004,2011-6-24,1)insertinto BBSReply(RID,RTID,RS

19、ID,RUID,REmotion,RTopic,RContents,RTime,RClickCount)values(9002 ,2011,02,1002,2011-6-29,1)insertinto BBSReply(RID,RTID,RSID,RUID,REmotion,RTopic,RContents,RTime,RClickCount)values(9003 ,2003,01,1005,2011-6-27,1)insertinto BBSReply(RID,RTID,RSID,RUID,REmotion,RTopic,RContents,RTime,RClickCount)values

20、(9004 ,2005,01,1005,2011-6-24,1)-select* from BBSUsersselect* from BBSSectionselect* from BBSTopicselect* from BBSReply-select uname as ,Uemail as ,UregDate as from bbsUsers where -datediff(yyyy,uregdate,getdate()2 dateadd(yyyy,2,uregdate)2 dateadd(yyyy,2,uregdate)getdate()order by UPoint desc-updat

21、e bbsUsers set UState =3 where uid=1004-select*from bbsUserswhere UState = 1 or UState = 3-select RTopic as ,RTime as from bbsreplyorder by RTime desc-BBSTopic5select top 5 TTopic as ,TClickCount as from bbstopicorder by TClickCount desc-update bbstopic set ttime = 2011-6-27 where tid = 2002update b

22、bstopic set ttime = 2011-6-26 where tid = 2003update bbstopic set ttime = 2011-6-28 where tid = 2011update bbstopic set TLastClickT =2011-6-30 where tid = 2012update bbstopic set ttime = 2011-6-24 where tid = 2012-7,2-select top 2 tuid asID ,count(*) as from bbstopicwhere datediff(dd,ttime,getdate()=7group by tuid- -bbsTopic-Max()Min()IDselect tuid as ID,max(TReplyCount) ,min(TReplyCount) as from bbstopicgroup by tuid-T-SQLbegin -T-SQL declare minPoint int - -,minPoint select minPoint=min(upoint) from bbsUsers where dateadd(yyyy,2,uregdate)getdate() -

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1