亚洲免费在线-亚洲免费在线播放-亚洲免费在线观看-亚洲免费在线观看视频-亚洲免费在线看-亚洲免费在线视频

Database: coursera assignment 1

系統(tǒng) 2735 0

q.1:? Find the titles of all movies directed by Steven Spielberg.?

select title
from movie
where director = 'Steven Spielberg'

?

q.2:? Find all years that have a movie that received a rating of 4 or 5, and sort them in increasing order.

select year
from movie, rating
where movie.mid = rating.mid and rating.stars >= 4
group by movie.mid
order by year

?

q.3:? Find the titles of all movies that have no ratings.?

select title
from movie, rating
where movie.mid not in (select rating.mid from rating)
group by movie.mid

?

q.4:? Some reviewers didn't provide a date with their rating. Find the names of all reviewers who have ratings with a NULL value for the date.?

select name
from reviewer re, rating ra
where re.rid = ra.rid and ra.ratingdate is null

?

q.5:? Write a query to return the ratings data in a more readable format: reviewer name, movie title, stars, and ratingDate. Also, sort the data, first by reviewer name, then by movie title, and lastly by number of stars.?

select name, title, stars, ratingdate
from movie, reviewer, rating
where movie.mid = rating.mid and reviewer.rid = rating.rid
order by name, title, stars

?

q.6:? For all cases where the same reviewer rated the same movie twice and gave it a higher rating the second time, return the reviewer's name and the title of the movie.?

select name, title
from movie, reviewer, rating r1, rating r2
where movie.mid = r1.mid and reviewer.rid = r1.rid and r1.mid = r2.mid and r1.rid = r2.rid and r1.stars < r2.stars and r1.ratingdate < r2.ratingdate

?

q.7:? For each movie that has at least one rating, find the highest number of stars that movie received. Return the movie title and number of stars. Sort by movie title.?

select title, max(stars)
from movie, rating
where movie.mid = rating.mid
group by rating.mid
order by title

?

q.8:? For each movie, return the title and the 'rating spread', that is, the difference between highest and lowest ratings given to that movie. Sort by rating spread from highest to lowest, then by movie title.?

select title, max(stars) - min(stars) as spread
from movie, rating
where movie.mid = rating.mid
group by rating.mid
order by spread desc, title

?

q.9:? Find the difference between the average rating of movies released before 1980 and the average rating of movies released after 1980. (Make sure to calculate the average rating for each movie, then the average of those averages for movies before 1980 and movies after. Don't just calculate the overall average rating before and after 1980.)?

?

Database: coursera assignment 1


更多文章、技術(shù)交流、商務(wù)合作、聯(lián)系博主

微信掃碼或搜索:z360901061

微信掃一掃加我為好友

QQ號(hào)聯(lián)系: 360901061

您的支持是博主寫(xiě)作最大的動(dòng)力,如果您喜歡我的文章,感覺(jué)我的文章對(duì)您有幫助,請(qǐng)用微信掃描下面二維碼支持博主2元、5元、10元、20元等您想捐的金額吧,狠狠點(diǎn)擊下面給點(diǎn)支持吧,站長(zhǎng)非常感激您!手機(jī)微信長(zhǎng)按不能支付解決辦法:請(qǐng)將微信支付二維碼保存到相冊(cè),切換到微信,然后點(diǎn)擊微信右上角掃一掃功能,選擇支付二維碼完成支付。

【本文對(duì)您有幫助就好】

您的支持是博主寫(xiě)作最大的動(dòng)力,如果您喜歡我的文章,感覺(jué)我的文章對(duì)您有幫助,請(qǐng)用微信掃描上面二維碼支持博主2元、5元、10元、自定義金額等您想捐的金額吧,站長(zhǎng)會(huì)非常 感謝您的哦!!!

發(fā)表我的評(píng)論
最新評(píng)論 總共0條評(píng)論
主站蜘蛛池模板: 色综合久久综合 | 午夜一级毛片免费视频 | 亚洲最大成人网 色香蕉 | 日本大黄视频 | 欧美成人午夜视频在线观看 | 欧美精品日本一级特黄 | 日日夜夜骑 | 久久88香港三级台湾三级中文 | 国产精品探花一区在线观看 | 国产成人精品亚洲日本在线观看 | 阳光灿烂的日子在线观看 | 中文字幕 二区 三区 搜查官 | 久久久精品日本一区二区三区 | 亚洲综合精品一区二区三区中文 | 老司机午夜性大片免费 | 四虎影院黄色片 | 狠狠狠狠狠狠狠 | 久久精品综合网 | 免费在线黄色网 | 亚洲最大在线视频 | 国产精品最新 | 国产精品成人h片在线 | 综合色在线观看 | 999久久久免费精品国产牛牛 | 男人的天堂久久香蕉国产 | 天天操天天擦 | 美女黄色一级毛片 | 国产区精品 | 97色伦图片97色伦图影院久久 | 三级aa久久| www.亚洲一区二区三区 | 亚洲精品国产专区一区 | 色婷婷婷婷| www.av天天| 欧美v在线| 亚洲永久视频 | 日韩在线a视频免费播放 | 色综合天天综合网国产成人 | 欧美拍拍视频 | 日韩精品一区二区三区中文3d | 国产精品成人扳一级aa毛片 |