美国大学的数据库题目 大神帮我看看 绝对给高分
4个回答
展开全部
1,该博物馆是唯一有印象派风格的绘画作品
作为一项权利选择博物馆,收集了参加绘画AS B,上A.Painting ID = B.Painting的ID的不B.Style(选择绘画风格从为C c.Style >'印象派'组者C.Style)和B.Style ='印象派'的A.Museum组
2,馆内没有印象派风格的绘画作品。
博物馆,收集作为一项权利选择AS B A.Painting ID = B.Painting编号,在那里B.Style >'印象派'组
3 A.Museum,博物馆包含了参加绘画至少在19世纪的各种风格的绘画作品之一
然后再考虑这有点困难,
作为一项权利选择博物馆,收集了参加绘画AS B,上A.Painting ID = B.Painting的ID的不B.Style(选择绘画风格从为C c.Style >'印象派'组者C.Style)和B.Style ='印象派'的A.Museum组
2,馆内没有印象派风格的绘画作品。
博物馆,收集作为一项权利选择AS B A.Painting ID = B.Painting编号,在那里B.Style >'印象派'组
3 A.Museum,博物馆包含了参加绘画至少在19世纪的各种风格的绘画作品之一
然后再考虑这有点困难,
展开全部
1、该馆只存有impressionist风格的画作
Select Museum from Collection AS A right out join Painting AS B on A.Painting ID = B.Painting id where B.Style not in ( Select Style from Painting as C where c.Style <> 'impressionist' group by C.Style) and B.Style = 'impressionist' group by A.Museum
2、该馆没有impressionist风格的画作
Select Museum from Collection AS A right out join Painting AS B on A.Painting ID = B.Painting id where B.Style <> 'impressionist' group by A.Museum
3、该馆至少含有1张19世纪各种风格的画作
这个有点难,再考虑考虑
Select Museum from Collection AS A right out join Painting AS B on A.Painting ID = B.Painting id where B.Style not in ( Select Style from Painting as C where c.Style <> 'impressionist' group by C.Style) and B.Style = 'impressionist' group by A.Museum
2、该馆没有impressionist风格的画作
Select Museum from Collection AS A right out join Painting AS B on A.Painting ID = B.Painting id where B.Style <> 'impressionist' group by A.Museum
3、该馆至少含有1张19世纪各种风格的画作
这个有点难,再考虑考虑
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
1、只存有impressionist风格画作的馆
Select Museum from Collection AS A right out join Painting AS B on A.Painting ID = B.Painting id where B.Style not in ( Select Style from Painting as C where c.Style <> 'impressionist' group by C.Style) and B.Style = 'impressionist' group by A.Museum
2、没有impressionist风格画作的馆
Select Museum from Collection AS A right out join Painting AS B on A.Painting ID = B.Painting id where B.Style <> 'impressionist' group by A.Museum
3、至少含有1张19世纪各种风格画作的馆
select C.Museum from (select distinct A.Museum,B.Style from Collection as A inner join Painting as B on A.PaintingId=B.PaintingId where B.Century='19th') as C group by C.Museum having count(C.Style)=(select count(D.Style) from (select distinct Style from Painting) as D)
这个有点复杂,所以解释一下我的思路:
先求出含有19世纪画作的Museum与Style的所有组合C:(select distinct A.Museum,B.Style from Collection as A inner join Painting as B on A.PaintingId=B.PaintingId where B.Century='19th')
再对C用求出各Museum的Style数量count(C.Style),
同时求出所有Style的总数:(select count(D.Style) from (select distinct Style from Painting) as D)
最后在having语句中设置条件:风格数量等于风格总数的馆,即为所需列出的馆
以上语句可能有细微错误,仅提供思路给你参考,希望对你有用,并得到你的奖励。谢谢!
Select Museum from Collection AS A right out join Painting AS B on A.Painting ID = B.Painting id where B.Style not in ( Select Style from Painting as C where c.Style <> 'impressionist' group by C.Style) and B.Style = 'impressionist' group by A.Museum
2、没有impressionist风格画作的馆
Select Museum from Collection AS A right out join Painting AS B on A.Painting ID = B.Painting id where B.Style <> 'impressionist' group by A.Museum
3、至少含有1张19世纪各种风格画作的馆
select C.Museum from (select distinct A.Museum,B.Style from Collection as A inner join Painting as B on A.PaintingId=B.PaintingId where B.Century='19th') as C group by C.Museum having count(C.Style)=(select count(D.Style) from (select distinct Style from Painting) as D)
这个有点复杂,所以解释一下我的思路:
先求出含有19世纪画作的Museum与Style的所有组合C:(select distinct A.Museum,B.Style from Collection as A inner join Painting as B on A.PaintingId=B.PaintingId where B.Century='19th')
再对C用求出各Museum的Style数量count(C.Style),
同时求出所有Style的总数:(select count(D.Style) from (select distinct Style from Painting) as D)
最后在having语句中设置条件:风格数量等于风格总数的馆,即为所需列出的馆
以上语句可能有细微错误,仅提供思路给你参考,希望对你有用,并得到你的奖励。谢谢!
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
妈妈呀,一个字都不认识为什么不来点中国的呢
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询