當前位置:首頁 » 考試成績 » 學生課程成績資料庫

學生課程成績資料庫

發布時間: 2020-12-13 19:00:58

❶ ,從「學生成績管理系統」資料庫的「成績表」中統計每個課程平均分,最低分,最高分,按課程代碼升序排列

SQL中在統計每門課程的平均成績、最高成績和最低成績
select b.課程名,avg(a.分數) as 平均成績內,max(a.分數) as 最高成容績,min(a.分數) as 最低成績
from 成績表 a,課程表 b
where a.課程號=b.課程號
group by b.課程名

❷ 查詢每位學生的學號姓名選課的課程號成績,資料庫語言

select
t.sno,sname,avg(grade)
as
平均分,count(cname)
as
選課門數
from
student
t,sc
c,course
e
where
t.sno=c.sno
and
c.cno=e.cno
and
t.sno=
(select
top
1
t1.sno
from
student
t1,sc
c1,course
e1
where
t1.sno=c1.sno
and
c1.cno=e1.cno
and
e1.cname='數據結構'
order
by
c1.grade
desc)
group
by
t.sno,sname
1.
先用子查詢
查出課程最高分的同學的學號
2.
再根據學專號得到平均分agv和選屬課門數
count

❸ 現有一個「學生—課程—成績」資料庫,資料庫中包括三個表:

2.select sno,grade from sg;
3.insert into sg values (學號,課程.....);
4.update sg set grade = 95 where sno = 2012314;
5.delete from student where sno = 2012314;
6.create or replace VIEW name
as
select grade from 成績表;
這樣簡單都要問,你這樣出了社會回能找到工作答不?

❹ 資料庫查詢選修某課程學生的成績,並按降序排序

這是一個參數查詢題,實現sql代碼如下:
select
學號,成績
from
學生成績
where
課程編號=[請輸入課程編號]
order
by
成績
desc;
表名和欄位名請按實際調整

❺ 有一個[學生課程]資料庫,資料庫中包括三個表:

1.自己手動建吧!
2.select DISTINCT(Sno) from SG where Grade<60
3.update Student set Sage='22' where Sno='05001'
4.select cast(Grade) from Gourse where Cno=1
5.
CREATE PROCEDURE getDetailByName
@Sname NVARCHAR(10),
@intCount int ouput

AS
BEGIN
SELECT @intTotalCount=count(*) FROM Student WHERE Sname=@Sname
if @intCount =1
BEGIN
select * from Student where Sname=@Sname
END
ELSE
BEGIN
print '不存在此學生'
END
END
GO

6.select Sname,Ssex,Sage from where Ssex=N'男' and Sdept =N'計算機系' and Sname like '趙%'

7.

8.INSERT INTO Student(Sno,Sname,Ssex,Sage,Sdept) VALUES('05020','丁莉','女','17歲','計算機')

❻ 有一個「學生-課程」資料庫,資料庫中包括三個表:

1、創建「學生-課程」資料庫:將數據文件和日誌文件都存放在D盤自已學號的目錄下。其中數據文件和日誌文件初始大小都為1MB,自動增長率都為10%。

create database MyDB
on(
name='Student-SC',
filename='d:\自己學號\Student-SC.mdf',
size=1,filegrowth=10%)
log on
(name='Student-SClog',
filename='d:\自己學號\Student-SClog.ldf',
size=1,filegrowth=10%)
go

2、在「學生-課程」資料庫創建「學生」表,它由學號Sno、姓名Sname、性別Ssex、年齡Sage、所在系Sdept五個屬性組成,其中學號設為主鍵約束,性別設置檢查性約束。

use Student-SC
create table Student
(Sno char(5) primary key,
Sname varchar(20),
Ssex varchar(2),
Sage tinyint,
Sdept varchar(30),
check(Ssex in('男','女')))
go

3、查詢「學生」表中全體學生的學號與姓名

select Sno,Sname from Student

4、查詢年齡在20至23歲之間的學生的姓名、所在系和年齡

select Ssex,Sdept,Sage from Student where Sage between 20 and 23

5、 查所有姓劉的學生的姓名、學號和性別

select Sname,Sno,Ssex from Student where Sname like '劉%'

6、 查詢「學生選課」表中成績最高和成績最低的記錄,要求顯示學號(Sno)、課程號(Cno)、成績(Grade)三個屬性

select Sno,Cno,Grade from SC group by Sno,Cno having max(Grade) or min(Grade)

7、使用內部聯接查詢並顯示所有選修課程的同學的學號(Sno)、姓名(Sname)、性別(Ssex)、年齡(Sage)、所在系(Sdept)、課程號(Cno)、成績(Grade)屬性

select SC.Sno,Student.Sname,Student.Ssex,Student.Sage,Student.Sdept,SC.Cno,SC.Grade from SC inner join Student on SC.Sno=Student.Sno

8、向「學生」表中插入如下記錄:學號:』04160』、姓名:』王燕』、性別 :』女』、年齡:22、所在系: 』計算機科學系』

insert into Student values('04160','王燕','女',22,'計算機科學系')

9、將計算機科學系全體學生的成績置零

update SC set Grade=0 where exists(select Sno,Sdept from Student where Student.Sno=SC.Sno and Student.Sdept='計算機科學系')

10、在「學生」表中,刪除學號為』04160』同學的記錄
delete from Student where Sno='04160'

❼ 在資料庫查詢中查詢各門課程取得最高成績的學生姓名和成績

select
t.sno,sname,avg(grade)
as
平均分,count(cname)
as
選課門數
from
student
t,sc
c,course
e
where
t.sno=c.sno
and
c.cno=e.cno
and
t.sno=
(select
top
1
t1.sno
from
student
t1,sc
c1,course
e1
where
t1.sno=c1.sno
and
c1.cno=e1.cno
and
e1.cname='數據結構'
order
by
c1.grade
desc)
group
by
t.sno,sname
1.
先用子查詢
查出課程最高分的同學的學內號容
2.
再根據學號得到平均分agv和選課門數
count

❽ 跪求大神幫幫忙!!!有一個【學生選修課】資料庫,資料庫中包括三個表,學生表,課程表,成績表

//自己把中文替換成英文欄位名 我用的sql server資料庫
select 學號、姓名、性別、年齡、所在系 from 學生 order by 年齡 desc, 學號 asc
select 學號,姓名 from 學生 where 姓名 in( select 姓名 from 學生 group by 姓名 having count(*)>1 )
update 成績 set 成績=0 where CNO=1
如果/不是除法的話 只是字元串 (除法暫時有問題)下班了 明天再來寫
select C.課程號,D.課程名,D.成績 from COURSE C,(
select CONVERT(VARCHAR(50),A.排名)+'/'+CONVERT(VARCHAR(50),B.ZS) as '排名/人數',a.學號,a.課程名,a.成績 FROM (
select ROW_NUMBER() over(partition BY 課程名 order by 成績 desc) as 排名 ,* from GRADE where 學號='1') A,
(SELECT COUNT(*) as zs,課程名
FROM GRADE group by 課程名 ) B where a.課程名=b.課程名) D WHERE C.課程名=D.課程名

❾ SQL命令 「學生」資料庫中有 「學生表」、「課程表」和 「成績表」。 「學生表」中包含學號、姓名

1、首先在電腦上打開資料庫軟體。然後附加有學生表和成績表的資料庫。

❿ 資料庫名:學生成績資料庫

(1). 題干有問題,課程名只在課程表中存,需要關聯三個表才能查出全部要求數據,sql語句專如下:
select A.學號, A.姓名, B.課程屬名, C.分數 FROM 學生表 A, 課程表 B, 成績表 C where A.學號=C.學號 and B.課程號=C.課程號
(2).
insert into 學生表(班級編號,學號,姓名,性別) values ('00001','00009','張三','男')
(3).
select A.課程號, A.課程名, sum(b.分數) 總成績, avg(b.分數) 平均成績, max(b.分數) 最高分
from 課程表 A, 成績表 B
where A.課程號=B.課程號
group by A.課程號,A.課程名
having max(b.分數) > 90

熱點內容
武漢大學學生會輔導員寄語 發布:2021-03-16 21:44:16 瀏覽:612
七年級學生作文輔導學案 發布:2021-03-16 21:42:09 瀏覽:1
不屑弟高考成績 發布:2021-03-16 21:40:59 瀏覽:754
大學畢業證會有成績單 發布:2021-03-16 21:40:07 瀏覽:756
2017信陽學院輔導員招聘名單 發布:2021-03-16 21:40:02 瀏覽:800
查詢重慶2018中考成績查詢 發布:2021-03-16 21:39:58 瀏覽:21
結業考試成績怎麼查詢 發布:2021-03-16 21:28:40 瀏覽:679
14中醫醫師資格筆試考試成績查分 發布:2021-03-16 21:28:39 瀏覽:655
名著賞析課程標准 發布:2021-03-16 21:27:57 瀏覽:881
北京大學商業領袖高端培訓課程 發布:2021-03-16 21:27:41 瀏覽:919