有一个“学生-课程”数据库,数据库中包括三个表:6
发布网友
发布时间:2023-10-12 06:56
我来回答
共1个回答
热心网友
时间:2024-12-02 23:35
以oracle 为例:
1、create table student( Sno number(10) primary key,
Sname varchar2(20),
Ssex varchar2(2),
Sage number(10),
Sdept varchar2(20)
);
2、SELECT * FROM student FROM Sdept='计算机' ORDER BY Sno DESC
3、SELECT DISTINCT student.Sno,student.Sname,student.Ssex
FROM student,Course,SC
where student.Sno=SC.Sno AND Course.Cno=SC.Cno
AND Course.Ccredit=5 AND SC.Grade > 60
4、create or replace trigger my_trig
after delete on student
for each row
begin
delete from SC where Sno=:student.Sno;
end;