首页 > 电脑 > 试用SQL语句表达下列查询

试用SQL语句表达下列查询

电脑 2024-06-14

试用SQL语句表示如下查询

--1
selectS.Sno,Sname,Sdept,GradefromSJOINRONS.Sno=R.Sno
--2
selectCnamefromCwhereCnoin(selectCnofromRwhereSnoin(selectSnofromSwhereSname='刘华'))
--3
selectCOUNT(*)选修人数,MAX(Grade)最高分,MIN(Grade)最低分fromRjoinConR.Cno=C.CnowhereCname='数据库'
--4
selectSname,COUNT(*)选修课门数,AVG(Grade)平均分fromSJOINRONS.Sno=R.Sno
groupbySnamehavingCOUNT(*)>=3orderby选修课门数desc
--5
insertintoSvalues('S10','谢霆锋','男',23,'计算机')
insertintoRvalues('S10','C03',90)
--6
updateRsetGrade=Grade*1.1whereCnoin(selectCnofromCwhereCname='数据库')
--7
deleteSwhereSdept='数学系'

请用SQL语句实现以下查询。

1) select sname,score from swre 2)select avg(score) from swre s ,stu u, gva g where s.sname=u.sname and g.g#='三年级' and s.s#=g.s# 3)select u.sname from swre s ,stu u, gva g where s.sname=u.sname and g.g#='三年级' and s.s#=g.s# and s.score=max(score)

用SQL语言表示下列查询

SELECT TOP 1 A.C# AS 公司编号,B.CNAME AS 公司名称,SUM(A.SQLRAY) AS 工资额 FROM WORKS AS A LEFT JOIN C AS B ON A.C#=B.C# GROUP BY A.C#,B.CNAME ORDER BY 工资额

从学生表、选课表、课程表,试用SQL语句表示下列查询语句: (1)列出全部学生的信息。

1.

SELECT*
FROM学生表


2.

SELECT学号,姓名
FROM学生表
WHERE专业='软件测试专业'


3.

SELECT	课程号
FROM 课程表
WHERE 类型='必修课'

用SQL语言分别表示下列查询:

(1) select * from JOB where city='上海' (2) select SNO,* from SPJ A inner join PART B on A.Pno=B.Pno inner join SUPPLIER c on A.Sno=C.Sno where JNo='J1' (3) select SNO,* from SPJ A inner join PART B on A.Pno=B.Pno inner join SUPPLIER c on A.Sno=C.Sno where JNo='J1' and Pno='P1' (4) select SNO,* from S

标签:数据库 信息技术 sql语句 数据 查询

大明白知识网 Copyright © 2020-2022 www.wangpan131.com. Some Rights Reserved. 京ICP备11019930号-18