Fetch the top 10 videos having more number of views, along with the channel details.
Sort the output in the descending order of no_of_views, and then in the ascending order of channel_name.
video_nameno_of_viewschannel_name
TABLE CHANNEL:-
channel_id name owner_id created_datetime
350 Motivation grid 1011 2014-10-05 17:32
351 Marvel 1011 2014-10-05 17:32
352 Disney 1012 2015-09-10 15:32
353 Tedx 1013 2016-10-05 17:32
354 ETV 1011 2012-08-17 19:32
355 Maa 1012 2007-03-07 11:32
356 PewDiePie 1012 2004-10-05 11:32
357 VanossGaming 1013 2005-09-10 15:32
358 Markiplier 1013 2014-10-05 08:32
359 Ninja 1012 2016-08-17 17:32
360 WWE 1011 2016-09-10 12:32
361 Tech savvy 1011 2016-09-10 12:32
362 Marques Brownlee. 1012 2018-09-10 12:32
363 The Verge 1013 2015-09-10 12:32
TABLE VIDEO:-
video_id name duration_in_secs published_datetime no_of_views channel_id
1000 Getting My
Driver's License 3652 2011-12-05 19:00 10619 367
| Lele Pons
1001 Apple iPhone
X Review: The 4556 2021-01-19 20:12 140012 362
Best Yet!
1002 Victoria Beckham
Gives Strangers
Fashion Advice for 836 2021-01-19 20:12 75609 353
$2 in Central Park
| Vanity Fair
1003 4 Reasons I Don't
Like Thanksgiving 1751 2017-05-05 17:32 279351 350
|| Mayim Bialik
1004 Maroon 5 - What
Lovers Do 3186 2018-02-17 19:32 94945 354
(Live On The Ellen
DeGeneres Show/2017)
1005 Alicia Keys - When
You Were Gone 3737 2018-04-10 12:32 35526 361
1006 U.S. Navy Three
Carrier Formation in 3538 2021-01-19 20:12 180973 362
Western Pacific Ocean
1007 DIY - Simon's Cat
| NEW BLACK & WHITE! 1365 2012-09-07 11:32 106271 355
1008 You, but in emojis.
(YIAY #375) 3874 2021-01-19 20:12 16469 352
1009 100 People Hold
Their Breath for as
Long as They Can 2885 2015-05-17 19:32 272102 354
1010 Luke Bryan - Hooked
On It (Audio) 2106 2016-02-10 12:32 184471 366
EXPECTED OUTPUT:-
video_name no_of_views channel_name
... ... ...
select vc.name, vc.no_of_views, ch.name
from video_content as vc,channel as ch
order by vc.no_of_views;
Comments
Leave a comment