Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

using the three tables above in mysql use a select statement to display the user

ID: 3833182 • Letter: U

Question

using the three tables above in mysql use a select statement to display the useres in descending order based on how much they watched. the infromation displayed should be fname lname and length.

mysql> select from users I usrID I firstName I lastName I email 1 Bill Bennett I bbennett@gmail.com I Kyle Wolford I kylewolford1210gmail.com I Donner I Keli@yahoo.com Keli 4 I Stan I Farber Stan yahoo.com Leo I Chappell I Leo@yahoo.com 6 Keli l McClaran Keli@yahoo.com I 7 I Bennett I Capshaw I Bennett Dyahoo.com I Tim Manhart I Tim yahoo.com I 9 l Aleisha I Donner I Aleisha@yahoo.com 10 I Buck Aylward I Buck@yahoo.com 11 l Wesley I Harwell I Wesley@yahoo.com 13 l Aleisha Ketter Aleisha@yahoo.com I 14 I Jarred Donner I Jarred Dyahoo.com 15 I Keli I Harwell I Keli@yahoo.com 16 Leo Leo Dyahoo.com Agar I 17 Josie I Chappell I Josie @yahoo.com 16 rows in set (0.00 sec)

Explanation / Answer

select u.firstName, u.lastName , sum(m.length) as tlength from users u, watches w , movies m

where u.usrID = w.usrID and w.movieID = m.movieID group by w.usrID,u.firstName, u.lastName

order by tlength desc;