Answer to Question #169482 in Databases | SQL | Oracle | MS Access for Chandra sena reddy

Question #169482

For all the videos, represent the number of views in multiples of thousands.

For example, if the number of views of a video is 17,200, it is represented as 17.2 in the output.


Note:

  • Sort the output in the descending order ofno_of_views_in_thousands, and then in the alphabetical order ofname



Table: video

video_id	name	no_of_views_in_thousands
    ...	     ...	        ...

just tell me the form of converting the views of videos for EX 17,200 into 17.2.

and the code i had written for this is:-

SELECT

 video_id,

 name,

 (no_of_views) AS no_of_views_in_thousands

FROM

 video

WHERE

 cast(strftime("%d", no_of_views) AS float)

ORDER BY

 no_of_views_in_thousands DESC,

 name ASC;


1
Expert's answer
2021-03-08T10:09:55-0500

The required query with the expected result are given below-

SELECT * FROM mydb.channel_traffic where no_of_views>4000 ORDER BY no_of_views,name desc;

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS