|
|
@@ -1,29 +0,0 @@ |
|
|
|
create table tvseries as select tconst, primarytitle as title from basics where titletype = 'tvSeries'; |
|
|
|
create table tvepisodes as select tconst, primarytitle as title from basics where titletype = 'tvEpisode'; |
|
|
|
create table episoderatings as select episodes.tconst, parenttconst as parent, seasonnumber as season, episodenumber as episode, averagerating as rating, numvotes as votes from ratings, episodes on (ratings.tconst = episodes.tconst) where seasonnumber != '\N'; |
|
|
|
create table epratings as select episoderatings.tconst, title as seriestitle, season, episode, rating, votes from episoderatings,tvseries on (episoderatings.parent = tvseries.tconst); |
|
|
|
create table final as select seriestitle, season, episode, title as episodetitle, rating, votes from epratings,tvepisodes on (epratings.tconst = tvepisodes.tconst); |
|
|
|
|
|
|
|
|
|
|
|
create table final as |
|
|
|
select seriestitle, |
|
|
|
season, |
|
|
|
episode, |
|
|
|
title as episodetitle, |
|
|
|
rating, |
|
|
|
votes |
|
|
|
from |
|
|
|
(select episoderatings.tconst, |
|
|
|
title as seriestitle, |
|
|
|
season, |
|
|
|
episode, |
|
|
|
rating, |
|
|
|
votes |
|
|
|
from |
|
|
|
(select episodes.tconst, |
|
|
|
parenttconst as parent, |
|
|
|
seasonnumber as season, |
|
|
|
episodenumber as episode, |
|
|
|
averagerating as rating, |
|
|
|
numvotes as votes |
|
|
|
from ratings, episodes on (ratings.tconst = episodes.tconst) where seasonnumber != '\N') as episoderatings, (select tconst, primarytitle as title from basics where titletype = 'tvSeries') as tvseries on (episoderatings.parent = tvseries.tconst)) as epratings, (select tconst, primarytitle as title from basics where titletype = 'tvEpisode') as tvepisodes on (epratings.tconst = tvepisodes.tconst); |