首页 养生问答 疾病百科 养生资讯 女性养生 男性养生

电影院数据库的sql问题

发布网友

我来回答

3个回答

热心网友

1 select firstname from actor where birthplace=‘Japan’ and birthplace=‘Sweden’ order by lastname asc--升序 或者 desc----降序
select firstname from actor where birthplace=‘Japan’ and birthplace=‘Sweden’ order by birthplace 后面同上
2 select count(mvid*) from ranking
3 select studio from movieinfo where mvid in (select count(mvid) from cast where actorID in (select actorID from actor where birthplace='UK' ) group by mvid having count(mvid>2))
后面的等等 哈哈
4select username,email from member where username in (select username from ranking where score<4 or score is null)-----如果你数据库中score字段有空格数据 在null后面 加上 空格score=' ' 就行了
5 select username,email from member where EXISTS (select username from ranking where score<4 or score is null)-----如果你数据库中score字段有空格数据 在null后面 加上 空格score=' ' 就行了追问谢谢你,很正确,但是第三题显示错误missing right parenthesis,求高手修改

追答select studio from movieinfo where mvid in (select count(mvid) from cast where actorID in (select actorID from actor where birthplace='UK' ) group by mvid having count(mvid)>2) 我的having count(mvid)>2)那个括号错了 哈哈 马虎了 怎么不给我最佳答案啊

热心网友

第一题:
select firstname, lastname, gender , birthplace from Actor where birthplace='Japan'
select firstname, lastname, gender , birthplace from Actor where lastname='Sweden'
第二题:
如果是查询所有
select count(*) from Ranking
查询不用电影的投票
select count(*) from Ranking group by mvid*
第三题:
不明白题意
第四题:
select username,email from Member where username not in
(select username from Ranking group by username having max(score)<=4)
第五题
select username,email from Member where not exists
(select username from Ranking group by username having max(score)<=4)追问要列出的是studios
条件是这些studio里拍的电影里有1个以上的UK的演员
要防止重复输出

热心网友

1.select firstname,lastname,gender,birthplace from Actor where birthplace in ('Japan','Sweden') order by birthplace,lastname
2.select count(*) from (select distinct username from Ranking)

声明声明:本网页内容为用户发布,旨在传播知识,不代表本网认同其观点,若有侵权等问题请及时与本网联系,我们将在第一时间删除处理。E-MAIL:11247931@qq.com