1、sql期末考试试题及答案
查询题:1).select*fromEMPwhereDEPTNO='20';2).select*fromEMPwhereENAMElike'MA%';3).select*fromEMPorderbyJOB;4).selectb.DNAME,COUNT(a.*)asnumfromEMPaleftjoinDEPTbona.DEPTNO=b.DEPTNOgroupbyb.DNAME5).select*fromEMPwhereSAL>(selectmax(SAL)asSALfromEMPwhereDEPTNO='20');程序题:1).函数:CREATEFUNCTION[SumN](@nINT)RETURNSINTASBEGINdeclare@outINT,@iintset@out=0set@i=1while@i<=@nbeginset@out=@out+@iset@i=@i+1endreturn(@out)END2).存储过程:CREATEPROCEDURE[emp_info](@nDECIMAL(2))ASselect*fromEMPwhereDEPTNO=@n视图和索引1).CREATEVIEW[emp10_view]ASselect*fromEMPwhereDEPTNO='10'2).ALTERTABLE[EMP]ADDCONSTRAINT[IX_Empno]PRIMARYKEYCLUSTERED([empno]ASC)
2、期末考试试卷的答案全部
我要有都快十点了还在自习室