Answer to Question #198973 in Databases | SQL | Oracle | MS Access for jay

Question #198973

Consider an online video-sharing platform like YouTube which hosts tens of thousands of channels and crores of users.

Database

The sample database consists of tables that store the information of users, channels, videos, genres and likes/dislikes.

Note:

channel_user table

channel_iduser_idsubscribed_datetime10012020-12-10 10:30:4510072020-10-10 11:30:45.........

channel_usertable stores the data of the channel_ids and their subscribers' user_ids.First row in the table represents that the user with user_id = 1 is subscribed to the channel with channel_id = 100 at

2020-12-10 10:30:45user_likes table

user_idvideo_idreaction_typereacted_at110LIKE2020-12-10 10:30:45710DISLIKE2020-10-10 11:30:45............

Similarly,

user_likestable stores the data of video_id and the user_ids who reacted to the video.video_genre table

video_idgenre_id1020110202......

Similarly,

I CAN EXPLAIN QUESTION CLEARLY....


1
Expert's answer
2021-05-26T23:29:18-0400
CREATE TABLE IF NOT EXISTS `Youtube`.`user_likes` (
  `user_id` INT NOT NULL,
  `video_id` INT NOT NULL,
  `reaction_type` VARCHAR(45) NOT NULL,
  `reacted_at` DATETIME NOT NULL,
  PRIMARY KEY (`video_id`))
ENGINE = InnoDB;

CREATE TABLE IF NOT EXISTS `Youtube`.`video_genre` (
  `video_id` INT NOT NULL,
  `genre_id` INT NOT NULL,
  PRIMARY KEY (`genre_id`))
ENGINE = InnoDB;

CREATE TABLE IF NOT EXISTS `Youtube`.`channel_user` (
  `user_id` INT NOT NULL,
  `channel_id` INT NULL,
  `subscribed_date` DATE NOT NULL,
  `Time` TIME NOT NULL,
  PRIMARY KEY (`user_id`))
ENGINE = InnoDB;

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