山东大学数据库系统SQL上机实验代码test2——test8(2014最新版)
Test2
(1)create table test2_01 as select sid,name
From pub.student p
where not exists (select cid from pub.student_course where sid=p.sid)
(2)create table test2_02 as select sid,name
From pub.student natural join pub.student_course
Where cid in (select cid from pub.student_course where sid=’200900130417’)
(3)create table test2_03 as select sid,name
From pub.student natural join pub.student_course
Where cid in (select cid from pub.course where fcid=’300002’)
(4)create table test2_04 as select sid,name
From pub.student
Where sid in(select sid from pub.course ,pub .student_course where student_course.cid=course.cid and name='操作系统' )
And
sid in(select sid from pub.course ,pub .student_course where student_course.cid=course.cid and name='数据结构' )
(5)create table test2_05 as select student.sid,name,cast(avg(score) as numeric(5,0)) avg_score, sum (score) sum_score
from pub.student_course,pub.student
Where pub.student_course.sid=pub.student.sid and age='20'
group by student.sid,name
(6)create table test2_06 as select cid,max(score)max_score
From pub.student_course
Group by cid
(7)create table test2_07 as select sid,name
From pub.student
Where name not in (select name from pub.student where name like (‘张%’) or name like (‘李%’) or name like (‘王%’)
(8)create table test2_08 as select substr(name,1,1) second_name,count (*) p_count
From pub.student
Group by substr(name,1,1)
(9)create table test2_09 as select pub.student.sid,name,score
From pub.student,pub.student_course
Where pub.student.sid=pub.student_course.sid and cid='300003'
(10)create table test2_10 as select sid,cid
From pub.student_course
Where score is not null
Test3
(1)create table test3_01 as select * from pub.Student_31
delete from test3_01 where length(translate(sid,'\0123456789','\'))>0
(2)create table test3_02 as select * from pub.Student_31
delete from test3_02 where age<>2012-extract(year from birthday)
你可能喜欢
- SQL数据库查询
- 论文数据库
- 数据库备份方法
- 非关系数据库
- 数据结构和程序设计
- 提高速度 优化SQL Server数据库查询5页
- 第4章 掌握数据库查询语言T-SQL29页
- SQL_server_2008数据库查询核心指南52页
- 第六章 关系数据库查询语言SQL38页
- 第5章 关系型数据库查询语言SQL64页
- 第8章 SQL关系数据库查询语言37页
- PQDD (ProQuest Digital Dissertations)美国博、硕士论文数据库指南23页
- 国内外免费论文数据库总结1页
- pqdd博硕士论文数据库 - PQDD检索指南2页
- 国内外学位论文数据库检索82页
- 5.5-ProQuest_博硕论文数据库讲座26页
- 美国硕博论文数据库9页
- 数据库备份方法4页
- wordpress本地数据库备份方法2页
- 瑞星企业版杀软系统中心数据库备份方法3页
- Oracle数据库备份与恢复的三种方法5页
- ORACLE数据库备份方法大总结3页
- oracle数据库备份的方法4页


