
1.insert into student(sno,sname,sex) select s.sno,s.sname,s.sex from sc sc left join s s on s.sno=sc.snoleft join c c on sc.cno=c.cno where sc.grade>=80 and sc.cno='第一门课程'2.delete from sc where grade=0 or grade is null3.delete from sc where sno='0001'4.update sc set grade=0 where sno in (select sc.sno from sc sc left join c c on sc.cno=c.cnowhere c.cname='
数据库应用' and sc.grade<60)5.update sc set grade=grade*1.05
where sno in(
select sc.sno
from sc sc
left join s s
on sc.sno=s.sno
where grade<(select avg(grade) from sc)
and s.ssex='f'
)
6.update sc set grade=grade*1.04
where grade>75 and cno='c001'
update sc set grade=grade*1.05
where grade<=75 and cno='c001'
SC表是S表的子表。SQL
语句创建sc表,数据库sc表的意思SC表是S表的子表,共同组成了一个候选码,因为
他们的任何一个子集都不能唯一确定表中的一列,数据库是按照数据结构来组织、存储和管理数据的建立在计算机存储设备上的仓库。
评论列表(0条)