
s.sno,s.sname
from
s,c,sc
where
s.sno=sc.sno
and
c.cno=sc.cno
and
c.cname="MS"
2.select
s.sno
from
s,sc
where
s.sno=sc.sno
and
sc.cno="c1"
or
s.sno=sc.sno
and
sc.cno="c2"
group
by
s.sno
3.select
s.sno,sc.grade
from
s,c,sc
where
s.sno=sc.sno
and
c.cno=sc.cno
and
c.cname=" *** 作系统"
or
c.cname="数据库课程"
4.select
s.sno,s.sname,s.age
from
s
where
s.sex="女"
and
s.age
>=18
and
s.age
<=
20
5.select
s.sno,s.sname,sc.grade
from
s,c,sc
where
s.sno=sc.sno
and
c.cno=sc.cno
and
c.teacher="刘平"
6.select
s.sname,s.age,s.SD
from
s
where
s.sname="李%"
7.select
s.sname,s.age,s.SD,count()
as
统计
from
s,sc
where
s.sno=sc.sno
and
统计
>3
group
by
s.sno
打那么多不容易再追加点分吧
1.select 职工.职工号, 姓名 from 职工,社会团体 ,参加 where 职工.职工号=参加.职工号 and 参加.编号 in (select 编号from 社会团体 where 名称='歌唱队' or 名称='篮球队')2. select 职工号, 姓名 from 职工,社会团体 ,参加 where 职工.职工号=参加.职工号 and 参加.编号not in (select 编号from 社会团体)
3.select 职工.职工号, 姓名 from 职工,社会团体 ,参加 where 职工.职工号=参加.职工号 and 参加.编号 in (select 编号from 社会团体)
瞌睡吖,睡啦,明个再写吧
第一个:select MAX(职工号)
from 职工
where 职工. 部门号 in (select部门号 from 部门)
第二个:
create proc procStaff
@staffIDnvarchar(30)--@staffID表示职工号
as
select 月工资, avg(select 月工资 from 职工 where 职工号 = @staffID
and部门 in (select 部门号 from 部门))
from 职工
where 职工号 = @staffID
第三个:
selectproductID , productName , Max(clickNum)
from productInfo
where productInfo.parentIDin(select chassID from className group by classID)
groupbyproductName
order by Max(clickNum) desc
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)