select 课程号,总分,平均分,最高分,最低分(
select 课程号,
总分=sum(成绩),
平均分=sum(成绩)/count(*),
最高分=max(成绩),
最低分=min(成绩)
from 成绩
group by 课程号) as kc order by 平均分 desc
11.题答案
select 课程号,
平均分=sum(成绩)/count(*)
from 成绩
where 课程号='1001' or 课程号='1002'
group by 课程号
12.题答案
select 姓名,xs.学号,kc.平均分
from 学生 as xs
left join (select 学号,
平均分=sum(成绩)/count(*)
from 成绩
group by 学号) as kc on kc.学号=xs.学号
where kc.平均分>80
1.create database Readbookon
(name=Readbook_data,filename='D:\server\Readbook_data.mdf',size=2mb,maxsize=10mb,filegrowth=1mb)
log on
(
name=Readbook_log,
filename='D:\server\Readbook_log.ldf',size=1mb,maxsize=5mb,filegrowth=1mb
)
go
2.use mybase
go
alter database mybase
add log file
(
name=Readbook2_log,
filename='D:\server\mybase2_log.ldf',size=2mb,maxsize=10mb,filegrowth=1mb
)
go
3.alter database mybase
remove file Readbook2_log
1 C 10 C 判断 1 对 2 错 3 错 4 对 5错2 A 11 D 6 错 7 对 8 对
3 A
4 A
5 A
6 C
7 C
8 A
9 A
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)