INSERT INTO `series` (`id`, `title`, `plot`, `imdb`, `poster`, `director`, `youtube_trailer`, `awards`, `year_start`, `year_end`) VALUES
(224, 'The Big Bang Theory', 'Leonard Hofstadter and Sheldon Cooper are both brilliant physicists working at Cal Tech in Pasadena, California. They are colleagues, best friends, and roommates, although in all capacities their relationship is always tested primarily by Sheldon\'s regimented, deeply eccentric, and non-conventional ways. They are also friends with their Cal Tech colleagues mechanical engineer Howard Wolowitz and astrophysicist Rajesh Koothrappali. The foursome spend their time working on their individual work projects, playing video games, watching science-fiction movies, or reading comic books. As they are self-professed nerds, all have little or no luck with women. When Penny, a pretty woman and an aspiring actress from Omaha, moves into the apartment across the hall from Leonard and Sheldon\'s, Leonard has another aspiration in life, namely to get Penny to be his girlfriend.', 'tt0898266', 0x[BLOB], NULL, 'https://www.youtube.com/watch?v=MfKtj5DnBz8', 'Won 1 Golden Globe. Another 73 wins & 249 nominations.', 2007, 2019);
INSERT INTO `series` (`id`, `title`, `plot`, `imdb`, `poster`, `director`, `youtube_trailer`, `awards`, `year_start`, `year_end`) VALUES
(227, 'Narcos', 'Narcos tells the true-life story of the growth and spread of cocaine drug cartels across the globe and attendant efforts of law enforcement to meet them head on in brutal, bloody conflict. It centers around the notorious Colombian cocaine kingpin Pablo Escobar (Wagner Moura) and Steve Murphy (Holbrook), a DEA agent sent to Colombia on a U.S. mission to capture and ultimately kill him.', 'tt2707408', 0x[BLOB], NULL, 'https://www.youtube.com/watch?v=sFlUFVJFGNA', 'Nominated for 2 Golden Globes. Another 8 wins & 16 nominations.', 2015, 2017);
INSERT INTO `series` (`id`, `title`, `plot`, `imdb`, `poster`, `director`, `youtube_trailer`, `awards`, `year_start`, `year_end`) VALUES
(228, 'Elite', 'When three working-class teenagers begin attending an exclusive private school in Spain, the clash between them and the wealthy students leads to murder.', 'tt7134908', 0x[BLOB], NULL, 'https://www.youtube.com/watch?v=99Q-va5jLbY', '3 nominations.', 2018, NULL);
INSERT INTO `series` (`id`, `title`, `plot`, `imdb`, `poster`, `director`, `youtube_trailer`, `awards`, `year_start`, `year_end`) VALUES
(230, 'Agents of S.H.I.E.L.D.', 'After the Battle of New York, the world has changed. It now knows not only about the Avengers, but also the powerful menaces that require those superheroes and more to face them. In response, Phil Coulson of the Strategic Homeland Intervention, Enforcement and Logistics Division assembles an elite covert team to find and deal with these threats wherever they are found. With a world rapidly becoming more bizarre and dangerous than ever before as the supervillains arise, these agents of S.H.I.E.L.D. are ready to take them on.', 'tt2364582', 0x[BLOB], NULL, 'https://www.youtube.com/watch?v=qDfxuM7NgQ0', 'Nominated for 2 Primetime Emmys. Another 6 wins & 44 nominations.', 2013, 2020);
INSERT INTO `series` (`id`, `title`, `plot`, `imdb`, `poster`, `director`, `youtube_trailer`, `awards`, `year_start`, `year_end`) VALUES
(231, 'Godless', 'In the 1880s American West murderous outlaw gang leader Frank Griffin hunts for ex-protege Roy Goode. Frank\'s chase leads him to La Belle, New Mexico - a town inhabited, after a mining disaster, almost entirely by women.', 'tt5516154', 0x[BLOB], NULL, 'https://www.youtube.com/watch?v=4IVYJkCAG3E', 'Won 3 Primetime Emmys. Another 4 wins & 27 nominations.', 2017, NULL);
INSERT INTO `series` (`id`, `title`, `plot`, `imdb`, `poster`, `director`, `youtube_trailer`, `awards`, `year_start`, `year_end`) VALUES
(232, 'Sherlock', 'In this modernized version of the Conan Doyle characters, using his detective plots, Sherlock Holmes lives in early 21st century London and acts more cocky towards Scotland Yard\'s detective inspector Lestrade because he\'s actually less confident. Doctor Watson is now a fairly young veteran of the Afghan war, less adoring and more active.', 'tt1475582', 0x[BLOB], NULL, 'https://www.youtube.com/watch?v=640ClSZxN98', 'Nominated for 1 Golden Globe. Another 88 wins & 172 nominations.', 2010, NULL);
INSERT INTO `series` (`id`, `title`, `plot`, `imdb`, `poster`, `director`, `youtube_trailer`, `awards`, `year_start`, `year_end`) VALUES
(233, 'Chernobyl', 'In April 1986, an explosion at the Chernobyl nuclear power plant in the Union of Soviet Socialist Republics becomes one of the world\'s worst man-made catastrophes.', 'tt7366338', 0x[BLOB], NULL, 'https://www.youtube.com/watch?v=skCiDK542aM', 'Won 2 Golden Globes. Another 55 wins & 57 nominations.', 2019, NULL);
INSERT INTO `series` (`id`, `title`, `plot`, `imdb`, `poster`, `director`, `youtube_trailer`, `awards`, `year_start`, `year_end`) VALUES
(234, 'The Handmaid\'s Tale', 'A religion-based autocracy has taken over most of the United States, renaming the country Gilead. In this country women are second-class citizens. Anyone trying to escape is punished. One such person is June, who is captured while trying to escape with her husband and child and is sentenced to be a handmaid, bearing children for childless government officials. As a handmaid, June is renamed Offred. This is her story.', 'tt5834204', 0x[BLOB], NULL, 'https://www.youtube.com/watch?v=JPVrg4kkuPw', 'Won 2 Golden Globes. Another 67 wins & 163 nominations.', 2017, NULL);

-- --------------------------------------------------------

--
-- Structure de la table `user_episode`
--

CREATE TABLE `user_episode` (
  `user_id` int(11) NOT NULL,
  `episode_id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Structure de la table `user_series`
--

CREATE TABLE `user_series` (
  `user_id` int(11) NOT NULL,
  `series_id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Index pour les tables exportées
--

--
-- Index pour la table `actor`
--
ALTER TABLE `actor`
  ADD PRIMARY KEY (`id`);

--
-- Index pour la table `actor_series`
--
ALTER TABLE `actor_series`
  ADD PRIMARY KEY (`actor_id`,`series_id`),
  ADD KEY `IDX_CD56D29B10DAF24A` (`actor_id`),
  ADD KEY `IDX_CD56D29B5278319C` (`series_id`);

--
-- Index pour la table `country`
--
ALTER TABLE `country`
  ADD PRIMARY KEY (`id`);

--
-- Index pour la table `country_series`
--
ALTER TABLE `country_series`
  ADD PRIMARY KEY (`country_id`,`series_id`),
  ADD KEY `IDX_7A68EA5EF92F3E70` (`country_id`),
  ADD KEY `IDX_7A68EA5E5278319C` (`series_id`);

--
-- Index pour la table `episode`
--
ALTER TABLE `episode`
  ADD PRIMARY KEY (`id`),
  ADD KEY `IDX_DDAA1CDA4EC001D1` (`season_id`);

--
-- Index pour la table `external_rating`
--
ALTER TABLE `external_rating`
  ADD PRIMARY KEY (`id`),
  ADD KEY `IDX_AC0AB9CB5278319C` (`series_id`),
  ADD KEY `IDX_AC0AB9CB953C1C61` (`source_id`);

--
-- Index pour la table `external_rating_source`
--
ALTER TABLE `external_rating_source`
  ADD PRIMARY KEY (`id`);

--
-- Index pour la table `genre`
--
ALTER TABLE `genre`
  ADD PRIMARY KEY (`id`);

--
-- Index pour la table `genre_series`
--
ALTER TABLE `genre_series`
  ADD PRIMARY KEY (`genre_id`,`series_id`),
  ADD KEY `IDX_D1A3310D4296D31F` (`genre_id`),
  ADD KEY `IDX_D1A3310D5278319C` (`series_id`);

--
-- Index pour la table `rating`
--
ALTER TABLE `rating`
  ADD PRIMARY KEY (`id`),
  ADD KEY `IDX_D88926225278319C` (`series_id`),
  ADD KEY `IDX_D8892622A76ED395` (`user_id`);

--
-- Index pour la table `season`
--
ALTER TABLE `season`
  ADD PRIMARY KEY (`id`),
  ADD KEY `IDX_F0E45BA95278319C` (`series_id`);

--
-- Index pour la table `series`
--
ALTER TABLE `series`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `UNIQ_3A10012D85489131` (`imdb`);

--
-- Index pour la table `user_episode`
--
ALTER TABLE `user_episode`
  ADD PRIMARY KEY (`user_id`,`episode_id`),
  ADD KEY `IDX_85A702D0A76ED395` (`user_id`),
  ADD KEY `IDX_85A702D0362B62A0` (`episode_id`);

--
-- Index pour la table `user_series`
--
ALTER TABLE `user_series`
  ADD PRIMARY KEY (`user_id`,`series_id`),
  ADD KEY `IDX_5F421A10A76ED395` (`user_id`),
  ADD KEY `IDX_5F421A105278319C` (`series_id`);

--
-- AUTO_INCREMENT pour les tables exportées
--

--
-- AUTO_INCREMENT pour la table `actor`
--
ALTER TABLE `actor`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=820;
--
-- AUTO_INCREMENT pour la table `country`
--
ALTER TABLE `country`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=20;
--
-- AUTO_INCREMENT pour la table `episode`
--
ALTER TABLE `episode`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=14143;
--
-- AUTO_INCREMENT pour la table `external_rating`
--
ALTER TABLE `external_rating`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=237;
--
-- AUTO_INCREMENT pour la table `external_rating_source`
--
ALTER TABLE `external_rating_source`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;
--
-- AUTO_INCREMENT pour la table `genre`
--
ALTER TABLE `genre`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=24;
--
-- AUTO_INCREMENT pour la table `rating`
--
ALTER TABLE `rating`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT pour la table `season`
--
ALTER TABLE `season`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=1130;
--
-- AUTO_INCREMENT pour la table `series`
--
ALTER TABLE `series`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=235;
--
-- Contraintes pour les tables exportées
--

--
-- Contraintes pour la table `actor_series`
--
ALTER TABLE `actor_series`
  ADD CONSTRAINT `FK_CD56D29B10DAF24A` FOREIGN KEY (`actor_id`) REFERENCES `actor` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `FK_CD56D29B5278319C` FOREIGN KEY (`series_id`) REFERENCES `series` (`id`) ON DELETE CASCADE;

--
-- Contraintes pour la table `country_series`
--
ALTER TABLE `country_series`
  ADD CONSTRAINT `FK_7A68EA5E5278319C` FOREIGN KEY (`series_id`) REFERENCES `series` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `FK_7A68EA5EF92F3E70` FOREIGN KEY (`country_id`) REFERENCES `country` (`id`) ON DELETE CASCADE;

--
-- Contraintes pour la table `episode`
--
ALTER TABLE `episode`
  ADD CONSTRAINT `FK_DDAA1CDA4EC001D1` FOREIGN KEY (`season_id`) REFERENCES `season` (`id`);

--
-- Contraintes pour la table `external_rating`
--
ALTER TABLE `external_rating`
  ADD CONSTRAINT `FK_AC0AB9CB5278319C` FOREIGN KEY (`series_id`) REFERENCES `series` (`id`),
  ADD CONSTRAINT `FK_AC0AB9CB953C1C61` FOREIGN KEY (`source_id`) REFERENCES `external_rating_source` (`id`);

--
-- Contraintes pour la table `genre_series`
--
ALTER TABLE `genre_series`
  ADD CONSTRAINT `FK_D1A3310D4296D31F` FOREIGN KEY (`genre_id`) REFERENCES `genre` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `FK_D1A3310D5278319C` FOREIGN KEY (`series_id`) REFERENCES `series` (`id`) ON DELETE CASCADE;

--
-- Contraintes pour la table `rating`
--
ALTER TABLE `rating`
  ADD CONSTRAINT `FK_D88926225278319C` FOREIGN KEY (`series_id`) REFERENCES `series` (`id`),
  ADD CONSTRAINT `FK_D8892622A76ED395` FOREIGN KEY (`user_id`) REFERENCES `user` (`id`);

--
-- Contraintes pour la table `season`
--
ALTER TABLE `season`
  ADD CONSTRAINT `FK_F0E45BA95278319C` FOREIGN KEY (`series_id`) REFERENCES `series` (`id`);

--
-- Contraintes pour la table `user_episode`
--
ALTER TABLE `user_episode`
  ADD CONSTRAINT `FK_85A702D0362B62A0` FOREIGN KEY (`episode_id`) REFERENCES `episode` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `FK_85A702D0A76ED395` FOREIGN KEY (`user_id`) REFERENCES `user` (`id`) ON DELETE CASCADE;

--
-- Contraintes pour la table `user_series`
--
ALTER TABLE `user_series`
  ADD CONSTRAINT `FK_5F421A105278319C` FOREIGN KEY (`series_id`) REFERENCES `series` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `FK_5F421A10A76ED395` FOREIGN KEY (`user_id`) REFERENCES `user` (`id`) ON DELETE CASCADE;

