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

Question #169748

This is the code for Getting all the channel_ids that uploaded at least one video in "AI/ML" or "Robotics" technologies between 2018 and 2021.


SELECT

 DISTINCT channel_id

FROM

 video

WHERE

 video_id >= 1

 AND name LIKE '%AI/ML%'

 OR name LIKE '%Robotics%'

 AND strftime('%Y', published_datetime) BETWEEN "2018"

 AND "2021"

GROUP BY

 channel_id

ORDER BY

 channel_id ASC;


Output Table:

channel_id
    351
    353
    364
    365
    377


But,

How can I Get all the channel_ids that uploaded at least 20 videos in "AI/ML", "Cyber Security", "Data Science" or "Robotics" technologies between 2018 and 2021.

Example: If a channel publishes 5 videos in AI/ML, 10 videos in Cyber Security and 5 videos in Data Science, consider the channel


the table data is very huge so, I cant send the complete table data.

please help me.




1
Expert's answer
2021-03-12T14:59:33-0500
select video_content.channelid
FROM quiz.video_content inner join user_details u on quiz.video_id=u.user_id
WHERE count(u.user_id) >= 20  AND name like '%DIY%' OR name LIKE '%Robotics%'
 "2018"  AND "2021" GROUP BY video_content.channelid
ORDER BY video_content.channelid ASC;

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

Assignment Expert
18.05.21, 14:39

Dear  Nagaraju M, please post a new question. 



Nagaraju M
18.05.21, 09:26

SELECT channel_id FROM video WHERE ( name LIKE "%AI/ML%" OR name LIKE "%Cyber Security%" OR name LIKE "%Data Science%" OR name LIKE "%Robotics%" ) AND ( strftime("%Y", published_datetime) BETWEEN "2018" AND "2021" ) GROUP BY channel_id HAVING count(video_id) >= 20 ORDER BY channel_id ASC;

Leave a comment

LATEST TUTORIALS
APPROVED BY CLIENTS