设在学生数据库中有三张表,表结构如下所示: Student(学生表): Student表的主键:sno(学号) Course(课程

2025年01月03日 08:47
有1个网友回答
网友(1):

(1) create table S_C
(sno char(10) not null
,cno char(8) not null
,score int null
,constraint PK_SC primary key (sno,cno)
)
(2)insert into Student (sno,sname,ssex)
values('1010','李小丽','女')
(3)create index IND_CName on Course (cname)
(4)update student set sage=23 where sno='1005'
(5)delete from course where cname='管理信息系统'
(6)select cno,cname,ctime
from course
where teacher='李元'
order by cno ASC
(7)select sno,sum(score) as score
from S_C
group by sno
(8)create view V_Student
as
select *
from student
where ssex='男' and sage>=18 and sage<=24
(9)select sno,sname
from student
where sno in (select sno from S_C where cno='001')
(10)select A.sno,A.sname
from student A
left join S_C B on A.sno=B.sno
left join Course C on B.cno=C.cno
where C.cname='关系数据库'
(11)select sno,sname from
(select A.sno,A.sname,count(1) as count_
from student A
left join S_C B on A.sno=B.sno
group by A.sno,A.sname) A
where count_>3
(12)select C.sname
from
(select * from S_C where cno='002') A
inner join
(select * from S_C where cno='004' on) B on A.sno=B.sno
left join student C on A.sno=C.sno