当前位置:首页 » 数据仓库 » 有一个学生课程数据库
扩展阅读
webinf下怎么引入js 2023-08-31 21:54:13
堡垒机怎么打开web 2023-08-31 21:54:11

有一个学生课程数据库

发布时间: 2022-06-24 21:59:17

Ⅰ 有一个“学生课程”数据库,数据库中包括三个表:

创建“学生-课程”数据库:将数据文件和日志有一个“学生-课程”数据库,数据库中包括三个表:
(1)“学生”表1使用T-sql语言完成下列操作1

Ⅱ 有一个[学生课程]数据库,数据库中包括三个表

1: 学生表
create table student
(s# int primary key,
name char(80),

sex char(20),

age int,

dept char(50)

)

2课程表
create table course
(c# int primary key,
cname char(50),
kh char(50),
score numeric(5,2)
)
3成绩表
create table sc
(s# int primary key,

c# char(50) not null,

score numeric(5,2)

)

Ⅲ 现有一个“学生—课程—成绩”数据库,数据库中包括三个表:

① create table Student( Sno int not null PRIMARY KEY ,Sname string Unique, Ssex string ,Sage integer, Sdept string )

② SELECT SG.Sno, SG.Grade FROM SG WHERE (((SG.Cno)=2))

③ INSERT INTO sg(Sno,Cno,Cname,Grade)valves(“2012314”,”2”, “数据库管理”,90)

④ UPDATE SG SET SG.Grade = 95 WHERE (((SG.Sno)=2012314))

⑤ DELETE SG.Sno FROM SG WHERE (((SG.Sno)=2012314))

⑥CREATE VIEW VSG AS select * from SG

Ⅳ 有一个[学生课程]数据库,数据库中包括三个表:

1
createtablestudent(
snovarchar(5)notnullprimarykey,
snamevarchar(10),
ssexchar(2),
sageint,
sdeptvarchar(20))

2


3
selectsno,gradefromsgwherecno=5orderbygradedesc

4
selectmax(grade)as最高成绩,avg(grade)as平均成绩fromsgwherecno=1

5
deletefromstudentwheresno='05019'

Ⅳ 有一个学生数据库,有以下关系模式构成: 学生(学号,姓名,性别,年龄,所在系)

1)
select
a.学号,a.成绩
from
选修
a,
课程
b
where
a.课程号=b.课程号
and
b.课程名='3号'
order
by
a.成绩
desc
--
如果不是按课程名查,可以不用连接"课程"表
2)
select
a.课程号,
b.课程名,
count(a.学好)
from
选修
a,
课程
b
where
a.课程号=b.课程号
group
by
a.课程号,
b.课程名
3)
select
b.姓名
from
选修
a,
学生
b
where
a.学号=b.学号
and
a.成绩
>
90
4)
insert
into
学生(学号,姓名,性别,年龄,所在系)
values
('012508','刘敏','女',18,'计算机')

Ⅵ 有一个“学生-课程”数据库,数据库中包括三个表: (1) “学生”表S由学号(Sno)、姓名(Sname)、性别

1)查出“计算机系”选课有“数据库基础与应用”学生的学号,姓名,成绩,按照学号升序显示
2)“信息工程系”学生的(avg)平均年龄,并打印结果。其中WHERE Sno= @S_Sno条件,没有定义@S_Sno怎么就给这个学号赋值了呢?
3)s=13
x=21
4)窗体加载时,Check1应该是一个控件名,当他的calue为0的时候。DataGrid数据控件允许删除功能,可以添加新信息(AllowAddNew不太确定,没有见过)

Ⅶ 有一个“学生-课程”数据库,数据库中包括三个表:

以oracle为例:

1、createtablestudent(Snonumber(10)primarykey,
Snamevarchar2(20),
Ssexvarchar2(2),
Sagenumber(10),
Sdeptvarchar2(20)
);
2、SELECT*FROMstudentFROMSdept='计算机'ORDERBYSnoDESC

3、SELECTDISTINCTstudent.Sno,student.Sname,student.Ssex
FROMstudent,Course,SC
wherestudent.Sno=SC.SnoANDCourse.Cno=SC.Cno
ANDCourse.Ccredit=5ANDSC.Grade>60

4、createorreplacetriggermy_trig
afterdeleteonstudent
foreachrow
begin
deletefromSCwhereSno=:student.Sno;
end;

Ⅷ 设有一个学生—课程数据库,其中包括三个表:

1.查询所有学生的学号、姓名、所在系
Select sno,sname,sdept
From student
2.查询全体学生的学号、姓名、性别,年龄,系别的信息
Select *
From student
3.查询全体学生的姓名及其出生年份
Select sname,datadiff(year,sage,2010) as 出生年份
From student
4.查询信息工程系全体学生的名单
Select sname
From student
Where sdept=’信息工程系’
5.查询所有年龄在20岁以下的学生姓名以及年龄
Select sname,sage
From student
Where sage<20
6.查询考试成绩不及格的学生的学号
Select sno
From score
Where grade<60
7.查询年龄在20-25(包括20、25)之间的学生的姓名、系别和年龄
Select sname,sdept,sage
From student
Where sage>=20 and sage<=25
8.查询不在软件系、网络系、也不在外语系学生的姓名和性别
select sname,sex
from student
where sdept <>'软件系、网络系、外语系'
9.查询所有姓李且全名为三个汉字的学生的姓名、学号、和性别
select sname,sno,sex
from student
where sname like '李_ _'
10.查询姓名中第二个字为'阳'字的学生的姓名
select sname
from student
where sname like '_阳%'
11.查询信息工程系年龄在20岁以下的学生的姓名
select sname
from student
where sage<20 and sdept='信息工程系'
12.查询选修了3号课程的学生的学号及其成绩,查询结果按分数的降序排列
select sno,grade
from score
where cno='3'
order by grade desc
13.查询全体学生的学号、姓名等情况,结果按照所在系的升序排序,同一系的按年龄降序排列
select sno,sname
from student
order by sdept asc,sage desc
14.统计学生总人数
select count(*) as 人数
from student
15.查询选修课课程的学生人数
select count(*) as 人数
from score
16.计算1号课程的学生平均分数
select avg(grade) 均分
from score
where cno='1'
17.查询选修了1号课程的学生最高分数
select max(grade) 最高分
from score
where cno='1'
18.求各课程号及相应的选修课人数
select cno,distinct(sno)
from score
group by cno
19.查询选修了3门以上课程的学生号
select sno
from score
group by sno
having count(cno)>3
20.查询选修2学分的课程且该课程的成绩在90分以上的所有学生的姓名
select sname
from student,course,score
where student.sno=score.sno and course.cno=score.cno and ccredit=2 and grade>90
21.查询每个学生的学号、姓名、选修的课程号和成绩
select student.sno,sname,cno,grade
from student,score,course
where student.sno=score.sno and score.cno=course.cno
22.查询所有选修了1号课程的学生姓名
select sname
from student,score
where student.sno=score.sno and score.cno='1'
23.查询选修了课程名为“计算机信息管理”的学生的学号和姓名
select sno,sname
from student,course,score
where student.sno=score.sno and course.cno=score.cno
and cname='计算机信息管理'

希望能给你帮助