【正文】
9。2000121239。,39。139。,39。15039。)insertinto BBSUsers(UID,UName,UPassword,UEmail,UBirthday,USex,UClass,UStatement,URegDate,UState,UPoint)values(39。100639。 ,39?;貋戆芍?9。,39。19244539。,39。zhenmi@39。,39。1994121439。,39。239。,39。39。,39。低調(diào)39。,39。2000121239。,39。139。,39。9739。)創(chuàng)建版塊insertinto BBSSection(SID,SName,SMasterID,SStatement,STopicCount)values(39。0139。 ,39。灌水區(qū)39。,39。100639。,39。有什么您就說39。,39。539。)insertinto BBSSection(SID,SName,SMasterID,SStatement,SClickCount,STopicCount)values(39。0239。 ,39。魔獸貼吧39。,39。100539。,39。請不要放水貼!39。,39。439。,39。1039。)發(fā)帖insertinto BBSTopic(TID,TSID,TUID,TReplyCount,TEmotion,TTopic,TContents ,TTime,TClickCount,TLastClickT)values(39。200139。 ,39。0139。,39。100539。,39。539。,39。+_~39。,39。無聊39。,39。無聊來冒個(gè)泡的。39。,39。201162639。,39。539。,39。20117439。)insertinto BBSTopic(TID,TSID,TUID,TReplyCount,TEmotion,TTopic,TContents ,TTime,TClickCount,TLastClickT)values(39。200239。 ,39。0239。,39。100139。,39。2039。,39。+_+39。,39。求指導(dǎo)39。,39。魔獸選哪個(gè)職業(yè)好?39。,39。201162739。,39。439。,39。20117439。)insertinto BBSTopic(TID,TSID,TUID,TReplyCount,TEmotion,TTopic,TContents ,TTime,TClickCount,TLastClickT)values(39。200339。 ,39。0139。,39。100439。,39。139。,39。+_+39。,39。00039。,39。我是打醬油的~39。,39。201163039。,39。139。,39。20117339。)添加回復(fù)insertinto BBSReply(RID,RTID,RSID,RUID,REmotion,RTopic,RContents,RTime,RClickCount)values(39。300739。 ,39。200139。,39。0139。,39。100439。,39。=39。,39。跟39。,39。繼續(xù)冒泡。39。,39。201162739。,39。139。)insertinto BBSReply(RID,RTID,RSID,RUID,REmotion,RTopic,RContents,RTime,RClickCount)values(39。300839。 ,39。200239。,39。0239。,39。100239。,39。_39。,39。加39。,39。看你的愛好了39。,39。201162739。,39。139。)insertinto BBSReply(RID,RTID,RSID,RUID,REmotion,RTopic,RContents,RTime,RClickCount)values(39。300939。 ,39。200339。,39。0139。,39。100539。,39。_39。,39。如39。,39。法師39。,39。20117139。,39。139。)查看結(jié)果及截圖select* from BBSUsersselect* from BBSSectionselect* from BBSTopicselect* from BBSReply查詢元老排名select UName as 姓名,UEmail as 電子郵件,URegDate as 注冊日期from BBSUsers where datediff(yyyy,URegDate,getdate())2顯示生日榜select UName as 姓名,UBirthday as 出生日期from BBSUserswhere day(getdate())=day(UBirthday) and month(getdate())=month(UBirthday) 按降序顯示所有元老用戶select UName as 姓名,Usex as 性別,Upoint as 積分,URegDate as 注冊日期from BBSUserswhere datediff(yyyy,URegDate,getdate())2 order by Upoint desc 查看用戶狀態(tài)select UName as 姓名,URegDate as 注冊日期,Ustate as 用戶狀態(tài)from BBSUserswhere UState = 1 or UState = 3按回帖時(shí)間的降序顯示所有回帖標(biāo)題與回帖時(shí)間select RTopic as 回帖標(biāo)題,RTime as 回帖時(shí)間from BBSreplyorder by RTime desc列出BBSTopic表中點(diǎn)擊次數(shù)最高的前3名帖子select top 5 TTopic as 主題標(biāo)題,TClickCount as 主貼點(diǎn)擊次數(shù)from BBStopicorder by TClickCount desc因?yàn)閿?shù)據(jù)原因無法顯示,先進(jìn)行數(shù)據(jù)修改update bbstopic set ttime = 39。201162739。 where tid = 39。200139。update bbstopic set ttime = 39。201162639。 where tid = 39。200239。update bbstopic set ttime = 39。201162939。 where tid = 39。200339。近一周用戶發(fā)帖排名根據(jù)系統(tǒng)日期向前推7天,之內(nèi)的發(fā)帖數(shù)排名前2名顯示中文列名select top 2 TUID as 用戶ID ,count(*) as 發(fā)帖數(shù)from bbstopicwhere datediff(dd,TTime,getdate())=7group by tuid查詢用戶所發(fā)帖子的最高和最低回帖數(shù)select tuid as 用戶ID,max(TReplyCount) 最多回帖數(shù),min(TReplyCount) as 最低回帖數(shù)from bbstopic,bbsreplygroup by tuid begin TSQL編程 declare @minPoint int 定義變量,表示元老最低積分 查詢所有元老用戶的最低積分,并賦值給@minPoint select @minPoint=min(upoint) from bbsUsers where dateadd(yyyy,2,uregdate)getdate() 提分操作 while(@minPoint100) begin update bbsUsers set Upoint=Upoint+2 where dateadd(yyyy,2,uregdate)getdate() and Upoint198 select @minPoint=min(Upoint) from bbsUSers where dateadd(yyyy,2,uregdate)getdate() end print 39。元老用戶提分完成,用戶積分的等級如下:39。 select uid 用戶ID,Uname 用戶名,等級=case when upoint1000 then 39。A39。 when upoint500 then 39。B39。 when upoint200 then 39。C39。 when upoint100 then 39。D39。 else 39。E39。 end from bbsUsersend 設(shè)計(jì)過程中質(zhì)疑(或答辯)記載:?答:constraint 主鍵名primary key。?答:數(shù)據(jù)字典最重要的作用是作為分析階段的工具。任何字典最重要的用途都是供人查詢對不了解的條目的解釋,在結(jié)構(gòu)化分析中,數(shù)據(jù)字典的作用是給數(shù)據(jù)流圖上每個(gè)成分加以定義和說明。換句話說,數(shù)據(jù)流圖上所有的成分的定義和解釋的文字集合就是數(shù)據(jù)字典,而且在數(shù)據(jù)字典中建立的一組嚴(yán)密一致的定義很有助于改進(jìn)分析員和用戶的通信。,它們用什么圖形來表示?答:包括實(shí)體、聯(lián)系、實(shí)體的屬性。實(shí)體用矩形來表示,聯(lián)系用菱形,屬性用橢圓