Answer to Question #234654 in Databases | SQL | Oracle | MS Access for Suraj

Question #234654

Get all the distinct user_ids who liked at least one video uploaded by Android Authority Channel (channel__id = 364) but didn't like the video uploaded by Tech savvy channel with video_id = 1005.

Note:

  • Consider reaction_type LIKE as liked
  • Sort the output in the ascending order of user_id.

Expected Output Format

user_id



1
Expert's answer
2021-09-12T04:58:48-0400
SELECT DISTINCT u.user_id
FROM user_likes u
INNER JOIN video_genre v ON u.video_id=v.video_id
INNER JOIN channel_user c ON u.user_id=c.user_id
WHERE (c.channel_id=364 AND u.reaction_type='LIKE') AND (u.video_id=1005 AND u.reaction_type='DISLIKE')
ORDER BY user_id;

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