电影名最长的3部电影和他们的总销量是多少

Table: Movies (Read-Only)

IdTitleDirectorYearLength_minutes
1Toy StoryJohn Lasseter199581
2A Bug's LifeJohn Lasseter199895
3Toy Story 2John Lasseter199993
4Monsters, Inc.Pete Docter200192
5Finding NemoFinding Nemo2003107
6The IncrediblesBrad Bird2004116
7CarsJohn Lasseter2006117
8RatatouilleBrad Bird2007115
9WALL-EAndrew Stanton2008104
10UpPete Docter2009101
11Toy Story 3Lee Unkrich2010103
12Cars 2John Lasseter2011120
13BraveBrenda Chapman2012102
14Monsters UniversityDan Scanlon2013110

Table: Boxoffice (Read-Only)

Movie_idRatingDomestic_salesInternational_sales
58.2380843261555900000
147.4268492764475066843
88206445654417277164
126.4191452396368400000
37.9245852179239163000
68261441092370001000
98.5223808164297503696
118.4415004880648167031
18.3191796233170162503
77.2244082982217900167
108.3293004164438338580
48.1289916256272900000
27.2162798565200600000
137.2237283207301700000

Table(表): Movies

TitleLenTotalSales
Monsters University19743559607
The Incredibles15631442092
Monsters, Inc.14562816256

 

  1. 电影名最长的3部电影和他们的总销量是多少 ✓

select title,length(title)
as len,   (Domestic_sales + International_sales) as totalSales
from movies inner join boxoffice on movies.id = boxoffice.movie_id
order by len desc
 limit 3;

©️2020 CSDN 皮肤主题: 大白 设计师:CSDN官方博客 返回首页