当前位置:首页 » 编程语言 » sqlserver实验答案
扩展阅读
webinf下怎么引入js 2023-08-31 21:54:13
堡垒机怎么打开web 2023-08-31 21:54:11

sqlserver实验答案

发布时间: 2022-01-14 14:09:26

① 急!!跪求sqlserver2005数据库设计试验,高分悬赏!!!

我靠。。。这么多,,有点难,,十个表,这完全相当于写个系统啊,,而且是比较复杂的系统,,要不我把我毕业项目发给你??不过我也没十个表啊。。

② sqlserver2005高级编程 求助答案

一,(1)select GID,GName,SalePrice from Gods where Cid=(select CId from GoodsClass where CName='日用商品')
(2) select b.Cid,b.cName,a.number from ( select cnunt(1) as number,CID as Cid from Goods group by CID ) as a left join GoodsClass as b on a.Cid=b.Cid
(3)Update Goods Set SalePrice=SalePrice-2 where Cid=(select CId from GoodsClass where CName in ('日用商品','文具类'))
(4)select a.CName,b.GName from GoodsClass as a left join Goods as b on a.cid=b.cid group by a.CName,b.GName
(5)select sum(Saleprice*Gamout) from Goods where Cid in (select CId from GoodsClass where CName='体育用品' )
二,
use 对应的数据库名称
go
create PROCEDURE dbo.sp_insert_SuperMarketUser
(
@UID varchar(100),
@UPassword varchar(100),
@UName varchar(100),
@URole varchar(100)
)
as

begin
insert into SuperMarketUser values(@UID,@UPassword,@UName,@URole)
go
--执行方式
exec dbo.sp_insert_SuperMarketUser('sky001','123456','xiaofang','超级管理员')
先写到这里 有时间再补充

③ 《sqlserver数据库管理》实验手册4.0 实验二创建数据库答案

打开企业管理器中,右键单击SQL Server组,新的SQL Server注册,根据指南,在可用的服务器中的下一个步骤上的远程服务器的IP来写,添加,下一步,选择身份验证方法,根据你的登录名和密码,另一边连接,并注册成功后,您可以使用相同的数据库操作机器。

查询分析器是一个链接到远程数据库SQL SERVER里面填满了IP和登录名和密码连接到远程数据库

④ sqlserver数据库编程题,求答案

自己看课本,自己去解决。这种题都要拿出来问,你还是不是学计算机专业的?

⑤ sqlserver实例教程2008版答案 刘志成编的

已发chm版,请查收。没有电子版PDF的。

⑥ SQLServer建 图书管理系统的数据库(简单填试验报告)

你这个问题3个数据表能搞定
1 读者表(ID、姓名、出生日期、最高借阅数量)
2图书表(图书编码、类型、书名、价格、最后借出时间、目前是否借出)
3借阅记录表(ID、图书编码、借出日期、归还日期、是否归还)
能够满足你上面这些条件的要求

(1)借书
图书表显示所有未借出的书,选择后,增加借阅记录表
(2)还书
根据读者列出未归还的借阅记录表,进行设置
(3)限定读者的年龄只能在18~60之间。
增加读者表时,判断出生日期,进行拦截
(4) 对数据库进行正常维护并保持数据的完整性。
不归程序管
(5) 不能删除已借出的图书的基本信息。
删除时,检查图书表的目前是否借出,只能删除为否的记录
(6) 查看某读者的借阅历史记录。
查借阅记录表
(7) 能查看某读者还能借阅的图书数。(允许经过两次操作得到答案)
一条sql语句就能解决,联查sum(借阅记录)与读者最高借阅数量相减
(8) 修改不同身份读者借阅图书的数量。 (只能更改一条记录)
更改读者最高借阅数量
(9) 统计图书借阅次数。
查询借阅记录
(10) 查看指定类型的图书情况。
查看图书表,根据类型
(11) 授予用户U1查看指定类型图书借阅次数的权限。
没看明白什么意思
(12) 查看从没被借阅过的图书。
查看图书表最后借出日期为空的记录
(13)查看书名包含相关信息的图书的信息。
模糊查询图书表
(14)查看借阅相关图书的读者的姓名。(要求用两种方法实现)
我只知道调用借阅记录表,不明白所谓两种方法指的什么
(15)查看某读者借阅的图书的总价。
联查图书表和借阅记录,sum图书价格

就这么多了,具体的还要你自己弄,毕竟是作业,别人写了,成别人的了,你什么都没学到

⑦ SQLserver数据库实训总结怎么写

这个主要要着重写几个方面,你一定要多写,写的详细一点。
1,管理系统的数据库需求【这个算是概况】
2,数据库对象模型设计
【设计核心部分】
3,数据库的创建以及表间关系,存储过程,视图,触发器的设计和定义。【标准定义部分】
4,数据库的优化设计,【这个你要是没有经验,就多测试,多写测试结果】
【着重在测试上多写点啊,比如,20万数据和100万数据的时候,你是如何优化查询的】
少说这里能写个几千字。
5,数据访问组件的代码结构,既然是管理系统,肯定要涉及数据访问。你把这个多写一点,比如不同组件之间的数据访问的差异,优势,弊端,你是如何改进的之类的。
7,BUG调试日志,开发这么个系统,肯定是中途经历了不少的错误和修改,你把这个过程写一点。
8,记录下你对于这个系统从设计到开发的经验,总结。
这么下来,怎么着也得1万字吧,要是再把参考的资料加上,恐怕能打印一小本了。

⑧ 求2015《SQLSERVER数据库基础》机试,的答案有吗

你好!

由于回答的字数限制,给你回答一下第一问题:

usemaster
createdatabaseNetBarDB--创建的数据库名称
onprimary--主文件组,primary可以省略
(
name=N'NetBarDB',--数据库文件的逻辑名
filename=N'D:NetBarDB.mdf',--全路径加上后缀
size=10mb,
maxsize=100mb,
filegrowth=1mb
)
logon--逻辑文件
(
name=N'TwoDataBase_log',--逻辑文件名,不能和前面的文件同名,一般都是下划线后加一个log
filename=N'D:NetBarDB.ldf',
size=100mb,
maxsize=1gb,
filegrowth=10mb
);
go

有什么问题,请您新开提问!

望采纳!

⑨ SQL Server 实用教程(第3版)课后实验答案 郑阿奇主编的 邮箱[email protected]

--查询全体学生的学号和姓名.
select Sno,Sname from Student

--查询全体学生的详细记录.
select * from Student

--查询所有选修课程的学生学号.
select distinct Sno from SC

--查询考试有不及格的学生学号.
select distinct Sno from SC where Grade<60

--查询不是信息系(is)、计算机系(cs)的学生性别、年龄、系别。
select Ssex,Sage,Sdept from Student where Sdept not in('is','cs')

--查询选修了4号课的学生学号和成绩,结果按成绩降序排列.
select Student.Sno,Grade from Student,SC where Cno='004' order by Grade desc

--查询每个课程号和相应的选课人数.
select Cno,count(Sno)选课人数 from SC group by Cno

--查询计算机系(cs)的学生姓名、年龄、系别。
select Sno,Sage,Sdept from Student where Sdept in('cs')

--查询年龄18~20岁的学生学号、姓名、系别、年龄。
select Sno,Sname,Sdept,Sage from Student where Sage between 18 and 20

--查询姓刘的学生的情况.
select * from Student where Sname like '刘%'

--查询既选修1号课程,又选修2号课程的学生学号.
select Sno from SC where Cno='001' and Cno='002'
select sno from SC where Cno='001' and Sno in (select Sno from SC where Cno='002')
select sno from SC where Cno='001' intersect select Sno from SC where Cno='002'

--查询学生的姓名和出生年份(今年2008年)
select Sname,2008-Sage as 出生年份 from student

--查询没有成绩的学生学号和课程号。
select Sno,Cno from sc where grade is null

--查询总成绩大于200分的学生学号。
select Sno from sc group by sno having sum(grade)>200

--查询每门课程不及格学生人数。
select cno,count(sno) 不及格人数 from sc where grade<60 group by cno

--查询不及格课程超过3门的学生学号。
select Sno from sc where grade<60 group by sno having count(grade)>3

--查询年龄为10~19岁的学生信息。
select * from student where Sage between 10 and 19

--查询全体学生情况,按所在系升序排列,同一个系的学生按年龄降序排列。
select * from student order by sdept, sage desc

--查询选了1号课程的学生平均成绩。
select avg(grade) from sc where cno='001'

--查询选了3号课程的学生的最高分。
select max(grade) from sc where cno='003'

--查询每个同学的总成绩。
select sno,sum(grade) 总成绩 from sc group by sno

---实验五

--查询每个学生及其选课情况。
select student.*,sc.*,course.* from student,sc,course where student.sno=sc.sno and sc.cno=course.cno
--select * from sc,student,course

--查询每门课程的间接选修课。
select first.cno,second.cpno from course first,course second where first.cpno=second.cno;

--将STUDENT,SC进行右连接。
select * from student,sc
select student.*,sc.* from student right join sc on student.sno=sc.sno

--查询有不及格学生的姓名和所在系。
select Sname,Sdept from student,sc where grade<60 and student.sno=sc.sno

--查询所有成绩为优秀(大于90)的学生姓名。
select Sname from student where sno in (select sno from sc group by sno having min(grade)>90)and sno not in (select sno from sc where grade is null) --错误
select sname from student,sc where student.sno=sc.sno and student.sno not in(select sno from sc where grade is null) group by sname having min(grade)>=90

--查询既选修了2号课程又选修了3号课程的学生姓名、学号。
select distinct Sname,Sc.Sno from student,sc where student.sno=sc.sno and sc.sno in(select sno from sc where cno='002' and sno in (select sno from sc where cno='003'))

--查询和刘晨同一年龄的学生。
select Sno,sname from student where sage=(select sage from student where sname='刘晨')

--选修了课程名为“数据库”的学生姓名和年龄。
select Sname,Sage from student where sno in(select sno from sc where cno=(select cno from course where cname='数据库'))

--查询其他系比IS系任一学生年龄小的学生名单。
select sname from student where sdept!='is'and sage<(select max(sage) from student where sdept='is')

--查询其他系中比IS系所有学生年龄都小的学生名单。
select Sname from student where sdept!='is' and sage<(select min(sage) from student where sdept='is')

--查询选修了全部课程的学生姓名.
select sname from student where not exists(select * from course where not exists(select * from sc where sno=student.sno and cno=course.cno)) --正确

--查询计算机系学生及其性别是男的学生.
select * from student where sdept='is' or ssex='男'

--查询选修课程1的学生集合和选修2号课程学生集合的差集。
select sc.sno from student,sc where student.sno=sc.sno and cno='001'
except
select sc.sno from student,sc where student.sno=sc.sno and cno='002'
--或者
select sno from sc where cno='001' and sno not in (select sno from sc where cno='002')

--查询李丽同学不学的课程的课程号.
select distinct cno from sc where cno not in (select cno from student,sc where sname='李丽'and student.sno=sc.sno)

--查询选修了3号课程的学生平均年龄.
select avg(sage) from student where sno in(select sno from sc where cno='003')

--求每门课程学生的平均成绩.
select cno,avg(grade) from sc group by cno

--统计每门课程的学生选修人数(超过3人的人统计)。要求输出课程号和选修人数,结果按人数降序排列,若人数相同,按课程号升序排列。

--查询学号比刘晨大,而年龄比他小的学生姓名。
select sname from student where sno>(select sno from student where sname='刘晨')and sage<(select sage from student where sname='刘晨')

--求年龄大于女同学平均年龄的男同学的姓名和年龄。
select sname,sage from student where sage>(select avg(sage) from student where ssex='女')and ssex='男'

--求年龄大于所有女同学年龄的男同学姓名和年龄。
select sname,sage from student where sage>(select max(sage) from student where ssex='女')and ssex='男'

--查询至少选修了08002选修的全部课程的学生号码。
--select cno from sc where sno='08002'
--select sno from sc where cno IN (select cno from sc where sno='08002')
--select * from sc A,sc B where A.SNO=B.SNO
--select * from (select distinct* from sc A,sc B where A.SNO=B.SNO)as e
select distinct sno from sc sc1 where not exists (select * from sc sc2 where sc2.sno='08002' and not exists (select * from sc sc3 where sc3.sno=sc1.sno and sc3.cno=sc2.cno))
--查询08001和08002两个学生都选修的课程的信息。
select course.* from course,sc where sno='08001' and course.cno=sc.cno intersect select course.* from course,sc where sno='08002' and course.cno=sc.cno
--查询跟'08001'同学同姓的学生信息
select * from student where sname like(select left(sname,1) from student where sno='08001')+'%'

⑩ SQLServer 用脚本比较两表差异。正确答案追加分。

(1)select * from A表 where column_1 not in (select column_1 from B表)
(2)select case when b.column_2 <> a.column_2 then b.column else null end as column_2,
后面的字段 from 表B as b
left join 表A a
on a.column_1=b.column_1