网站建设资讯

NEWS

网站建设资讯

nosql期末,nosql数据库期末考试

4道SQL期末考题求助,高分!

1,

成都网站建设哪家好,找创新互联建站!专注于网页设计、网站建设、微信开发、成都小程序开发、集团成都企业网站建设等服务项目。核心团队均拥有互联网行业多年经验,服务众多知名企业客户;涵盖的客户类型包括:成都OPP胶袋等众多领域,积累了大量丰富的经验,同时也获得了客户的一致赞扬!

use finalexamDB

go

create schema students

go

create type students.studentsID char(7) not null

2,

create trigger del_dept_trigger on dept after delete

as

begin

update emp

set deptno=null

from emp a inner join deleted b

on a.deptno=b.deptno

insert into historydept select * from deleted

end

3,

use adventureworks

go

exec sp_addumpdevice @devtype='disk',@logicalname='backupfull',@physicalname='C:\backup\db.bak'

go

backup database adventureworks to backupfull with init

4,

create login [studentlogin] with password='pa$$w0rd',default_database=adventureworks

SQL期末考试题,来个大神帮解答一下

select fph from mz_brsf

whereje 200;

2.select sum(je) from mz_brsf

where sfsj =  '2012-01-01'

and sfsj '2012-02-01';

3.delete from mz_bfsf

where cfh is null;

4.update mz_bfsf

set substr(sfsj,1,4) =2013

where ks ='内科' ;

5. select ks, sum(je) from mz_bfsf

group by ks

having sum(je) 500;

6.select top 2 ys,sum(je)

from mz_bfsf

group by ys

order by sum(je) desc;

7.update  a

set a.zc = b.zc

from mz_bfsf a,mz_brxx b

where  a.ys = b.ys

sql期末考试?

1、建立一个“学生”表Student,它由学号Sno、姓名Sname、性别Ssex、年龄Sage、所在系Sdept五个属性组成,其中学号属性不能为空,并且其值是唯一的。

其值是唯一的,并不是说是主键,应该用关键字UNIQUE

CREATETABLEStudent(

SnoSMALLINTNOTNULLUNIQUE,

SnameCHAR(8),

SsexCHAR(1),

SageSMALLINT,

SdeptCHAR(20))

2、查询全体学生的详细记录

SELECT*FROMStudent

3、查询年龄在20至23岁之间的学生的姓名、系别、和年龄

SELECTSname,Sdept,Sage

FROMStudent

WHERESageBETWEEN20AND23

4、计算1号课程的学生平均成绩

SELECTAVG(Grade)FROMSCWHERECno=1

5、将计算机科学系全体学生的成绩置零

UPDATESC

SETgrade=0

WHERESnoIN(SELECTSnoFROMStudentWHERESdept='计算机科学系')


标题名称:nosql期末,nosql数据库期末考试
本文地址:http://cdweb.net/article/dsgjgei.html