用SQL语句完成下列操作要求

2024-12-18 17:06:35
推荐回答(2个)
回答1:

1.insert into stuinfo(stuid,stname,sex,nation,class,address) values(2015121226,张三,男,白族,15计算机网络,云南大理);
2.delete course where cname='foxpro应用基础';
3.select stname as 姓名,round(to_number(to_char(sysdate,'yyyy')-to_char(birthdate,'yyyy'))) as 年龄,class as 班级 from stuinfo where round(to_number(to_char(sysdate,'yyyy')-to_char(birthdate,'yyyy')))>=20;
4.select st.stuid as 学号,st.stname as 姓名 from stuinfo st inner join course c on c.cid=st.stuid inner join score sc on sc.cid=c.cid where sc.score in (select max(score) from score);
5.select st.stuid as 学号,st.stname as 姓名,c.cname as 课程名称,sc.score as 成绩 from stuinfo st inner join course c on c.cid=st.stuid inner join score sc on sc.cid=c.cid;
6.select st.stname as 姓名 from stuinfo where address in (select address from stuinfo where stname='张三');
7.select stname as 姓名,to_char(sysdate,'yyyy')-to_char(substr(zjh,7,4)) as 年龄 from stuinfo
8.create or replace procedure stmax
as
fs nvarchar2(200);
mz nvarchar2(200);
begin
select c.cname into mz,sc.score into fs from course c inner join score sc on sc.cid=c.cid group by c.cname;
DBMS_OUTPUT.put_line(mz||':'||fs);
end;
9.触发器略过
10.略
11.update course set cname='数据库原理与应用' where cname='数据库原理';
12.select * from stuinfo where stname like '张%';
13.select * from stuinfo where nation !='汉族';
14.select c.cname,AVG(sc.score) from course c inner join score sc on sc.cid=c.cid group by c.cname;

累死,望采纳

回答2:

有。。。

。。

。。