34,838
社区成员




--(a):
select album from CD
where [year]<=(select [year] from CD where artist='Foo Fighters' and album='The Colour and the Shape')
--(b):
select artist from CD as t
where exists(select 1 from CD where CHARINDEX(t.artist,album)>0)
--(c):
select album from CD
where tracks in ((select MIN(tracks) from CD),(select MAX(tracks) from CD))
--(d):
select artist,SUM(tracks)/COUNT(album) as AvgTrack
from CD
group by artist
having COUNT(album)>1
--(e):
select artist,SUM(tracks)/COUNT(album) as AvgTrack
from CD as t
where exists(select 1 from CD where artist=t.artist and album<>t.album)
group by artist