Ⅰ 有一個「學生課程」資料庫,資料庫中包括三個表:
創建「學生-課程」資料庫:將數據文件和日誌有一個「學生-課程」資料庫,資料庫中包括三個表:
(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='計算機信息管理'
希望能給你幫助