1.假设学生—课程数据库关系模式如下: S(Sno,Sname,Sage,Ssex) C(Cno

1.假设学生—课程数据库关系模式如下: S(Sno,Sname,Sage,Ssex) C(Cno,第1张

1 select * from S

2 select sname, 2014-Sage from S

3 select sname, sage from S where sage between 20 and 22

4 select * from S order by sdept asc, sage desc

5 select S.sno, sname from S, C, SC where S.sno=SC.sno and SC.cno=C.cno and Cname='数据库

1)

SELECT Student.SName,Course.Cname,SC.Score

FROM SC

LEFT JOIN Student ON SC.SNo = Student.SNo

LEFT JOIN Course ON SC.CNo = Course.CNo

WHERE Student.SNo = '20080101'

2)

UPDATE Student SET SAge = SAge + 2

3.

INSERT INTO Student(SNo, SName, SAge, SDept) VALUES ('20080102', '李汉', '20', 'soft')


欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/sjk/6696441.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-03-26
下一篇 2023-03-26

发表评论

登录后才能评论

评论列表(0条)

保存