-- https://www.phpmyadmin.net/
--
-- Hôte : localhost:3306
-- Généré le : mar. 21 mai 2024 à 00:09
-- Version du serveur : 8.0.37
-- Version de PHP : 8.1.28

START TRANSACTION;



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

--
-- Structure de la table `genre`
--

CREATE TABLE `genre` (
  `id_genre` int NOT NULL,
  `nom_genre` varchar(50) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

--
-- Déchargement des données de la table `genre`
--

INSERT INTO `genre` (`id_genre`, `nom_genre`) VALUES
(1, 'Action'),
(2, 'Romance'),
(3, 'Aventure'),
(4, 'Fantasy'),
(5, 'Surnaturel'),
(6, 'Science-fiction'),
(7, 'Magie'),
(8, 'Horreur'),
(9, 'Mystère'),
(10, 'Drame');

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

--
-- Structure de la table `manga`
--

CREATE TABLE `manga` (
  `id_manga` int NOT NULL,
  `titre` varchar(100) DEFAULT NULL,
  `auteur` varchar(100) DEFAULT NULL,
  `id_genre` int DEFAULT NULL,
  `nb_exemplaires` int DEFAULT NULL,
  `cover` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

--
-- Déchargement des données de la table `manga`
--

INSERT INTO `manga` (`id_manga`, `titre`, `auteur`, `id_genre`, `nb_exemplaires`, `cover`) VALUES
(45, 'One Piece - Tome 1', 'Eiichiro Oda', 3, 47, 'images/9782723488525-T.jpg'),
(46, 'Chainsaw Man - Tome 17', 'Tatsuki Fujimoto', 1, 89, 'images/chainsaw_man_tome_17.jpg'),
(47, 'One Piece - Tome 3', 'Eiichiro Oda', 1, 19, NULL),
(48, 'Les fleurs du mal - Tome 9', 'Shuzo Oshimi', 1, 35, NULL),
(49, 'One Piece - Tome 5', 'Eiichiro Oda', 1, 0, NULL),
(66, 'Naruto - Tome 2', 'Masashi Kishimoto', 1, 25, NULL),
(67, 'Naruto - Tome 3', 'Masashi Kishimoto', 1, 46, NULL),
(68, 'One Piece - Tome 108', 'Eiichiro Oda', 1, 0, NULL),
(69, 'sqsqdlk', 'Masashi Kishimoto', 1, 42, NULL),
(70, 'Attack on Titan - Tome 1', 'Hajime Isayama', 1, 46, NULL),
(71, 'Attack on Titan - Tome 2', 'Hajime Isayama', 1, 45, NULL),
(72, 'Attack on Titan - Tome 3', 'Hajime Isayama', 1, 35, ''),
(73, 'Memories of Emanon', 'Shinji Kajio', 5, 21, 'images/91AQGtqYv9L._AC_UF1000,1000_QL80_.jpg'),
(74, 'Attack on Titan - Tome 5', 'Hajime Isayama', 7, 42, ''),
(75, 'My Hero Academia - Tome 1', 'Kohei Horikoshi', 7, 49, ''),
(76, 'My Hero Academia - Tome 2', 'Kohei Horikoshi', 7, 42, ''),
(77, 'My Hero Academia - Tome 3', 'Kohei Horikoshi', 1, 48, NULL),
(78, 'My Hero Academia - Tome 4', 'Kohei Horikoshi', 1, 42, NULL),
(79, 'My Hero Academia - 5', 'Kohei Horikoshi', 1, 40, NULL),
(81, 'slkdwj', 'sdpmofk', 1, 9023, ''),
(82, 'slkdwj', 'sdpmofk', 1, 9022, ''),
(83, 'slkdwj', 'sdpmofk', 1, 9022, ''),
(84, 'ojef', 'slk', 1, 135, ''),
(85, 'ojef', 'slk', 1, 137, ''),
(86, 'ojef', 'slk', 1, 137, ''),
(87, 'ojef', 'slk', 1, 137, ''),
(88, 'ojef', 'slk', 1, 136, ''),
(89, 'ojef', 'slk', 1, 136, ''),
(90, 'Chainsaw Man - Tome 1000', 'Tatsuki Fujimoto', 1, 0, NULL),
(91, 'ojef', 'slk', 1, 127, ''),
(92, 'ojef', 'slk', 1, 135, ''),
(93, 'oje', 'slk', 1, 137, NULL),
(94, 'lm', 'dlfk', 1, 234, NULL),
(95, 'Chainsaw Man - Tome 17', 'Tatsuki Fujimoto', 9, 50, NULL),
(96, 'Chainsaw Man - Tome 17', 'Tatsuki Fujimoto', 8, 40, NULL),
(97, 'Chainsaw Man - Tome 17', 'Tatsuki Fujimoto', 9, 82, NULL),
(98, 'dfld', 'dfpo', 6, 39, NULL),
(99, 'qpso', 'qsk', 7, 1983, NULL),
(100, 'sdkc', 'smkc', 1, 15, NULL),
(101, 'SDLC', 'WCO12736', 1, 2, NULL),
(102, 'spokc', 'scpk', 2, 26, NULL),
(103, 'sdw', 'sf^pxc', 4, 37, NULL),
(104, 'Look Back - OneShot', 'Tatsuki Fujimoto', 1, 0, NULL),
(105, 'Chainsaw Man - Tome 16', 'Tatsuki Fujimoto', 1, 100, NULL),
(106, 'klsa', 'slkq', 1, 5, NULL),
(107, 'klsa', 'slkq', 1, 5, NULL),
(108, 'klsa', 'slkq', 1, 5, NULL),
(109, 'oisdv', 'poxck ', 4, 1000, NULL),
(110, 'joefjo', 'eqpo', 1, 23, NULL),
(111, 'Chainsaw Man - Tome 17', 'Tatsuki Fujimoto', 1, 23, NULL),
(112, 'fxvdx', 'sdvx', 1, 12, NULL),
(113, 'Chainsaw Man - Tome 16', 'Tatsuki Fujimoto', 1, 93, NULL),
(114, 'sklcw', 'wclk', 1, 83, NULL),
(115, 'Radiant - Tome 1', 'Tony Valente', 3, 48, 'images/Radiant-t01.jpg'),
(116, 'Chainsaw Man - Tome 11', 'Tatsuki Fujimoto', 10, 48, 'images/9782820341280_1_75.jpg');

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

--
-- Structure de la table `reservation`
--

CREATE TABLE `reservation` (
  `id_reservation` int NOT NULL,
  `id_client` int DEFAULT NULL,
  `date_debut` date DEFAULT NULL,
  `date_fin` date DEFAULT NULL,
  `date_reservation` timestamp NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

--
-- Déchargement des données de la table `reservation`
--

INSERT INTO `reservation` (`id_reservation`, `id_client`, `date_debut`, `date_fin`, `date_reservation`) VALUES
(91, 81, '2024-05-31', '2024-07-01', '2024-05-19 18:57:35'),
(92, NULL, '2024-05-31', '2024-07-01', '2024-05-19 19:16:13'),
(93, NULL, '2024-05-31', '2024-07-23', '2024-05-19 19:16:27'),
(94, 80, '2024-05-31', '2024-07-01', '2024-05-19 19:37:33'),
(95, 80, '2024-05-31', '2024-07-01', '2024-05-19 19:37:40'),
(96, 81, '2024-05-31', '2024-07-01', '2024-05-19 22:26:53'),
(97, 81, '2024-05-31', '2024-07-01', '2024-05-19 23:46:54'),
(98, 81, '2024-05-31', '2024-07-01', '2024-05-19 23:47:18'),
(99, 81, '2024-05-31', '2024-07-01', '2024-05-19 23:49:10'),
(100, 81, '2024-05-31', '2024-07-01', '2024-05-19 23:49:12'),
(101, NULL, '2024-06-01', '2024-07-04', '2024-05-19 23:56:09'),
(102, NULL, '2024-06-01', '2024-07-02', '2024-05-19 23:56:35'),
(103, NULL, '2024-05-31', '2024-07-01', '2024-05-20 00:00:42'),
(104, 86, '2024-05-31', '2024-07-01', '2024-05-20 00:10:51'),
(105, 86, '2024-05-31', '2024-07-01', '2024-05-20 00:11:00'),
(106, 86, '2024-05-31', '2024-07-01', '2024-05-20 00:11:04'),
(107, NULL, '2024-05-31', '2024-07-01', '2024-05-20 00:11:25'),
(108, NULL, '2024-05-31', '2024-07-01', '2024-05-20 00:13:55'),
(109, 88, '2024-05-31', '2024-07-01', '2024-05-20 00:14:13'),
(110, NULL, '2024-05-31', '2024-07-01', '2024-05-20 00:17:22'),
(111, 93, '2024-05-31', '2024-07-01', '2024-05-20 00:28:09'),
(112, 85, '2024-05-31', '2024-07-01', '2024-05-20 00:28:50'),
(113, 94, '2024-05-31', '2024-07-01', '2024-05-20 00:43:19'),
(114, 84, '2024-05-31', '2024-07-01', '2024-05-20 09:20:41'),
(115, 81, '2024-05-31', '2024-07-01', '2024-05-20 11:32:42'),
(116, 81, '2024-05-31', '2024-07-01', '2024-05-20 14:46:11'),
(117, 81, '2024-05-31', '2024-07-01', '2024-05-20 18:00:24'),
(118, 81, '2024-05-31', '2024-07-01', '2024-05-20 18:04:32'),
(119, 81, '2024-05-31', '2024-07-01', '2024-05-20 18:04:34'),
(120, 81, '2024-05-31', '2024-07-01', '2024-05-20 18:05:53'),
(121, 81, '2024-05-31', '2024-07-01', '2024-05-20 18:09:58'),
(122, 81, '2024-05-31', '2024-07-01', '2024-05-20 18:10:20'),
(123, 81, '2024-05-31', '2024-07-01', '2024-05-20 18:10:37'),
(124, 81, '2024-05-31', '2024-07-01', '2024-05-20 18:12:41'),
(125, 81, '2024-05-31', '2024-07-01', '2024-05-20 18:13:21'),
(126, 81, '2024-05-31', '2024-07-01', '2024-05-20 18:15:52'),
(127, 81, '2024-05-31', '2024-07-01', '2024-05-20 18:16:03'),
(128, 81, '2024-05-31', '2024-07-01', '2024-05-20 18:16:14'),
(129, 81, '2024-05-31', '2024-07-01', '2024-05-20 18:17:43'),
(130, 81, '2024-05-31', '2024-07-01', '2024-05-20 18:18:09'),
(131, 81, '2024-05-31', '2024-07-01', '2024-05-20 18:18:17'),
(132, 79, '2024-05-31', '2024-07-01', '2024-05-20 20:37:19'),
(133, 81, '2024-05-31', '2024-07-01', '2024-05-20 20:50:12');

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

--
-- Structure de la table `reservation_manga`
--

CREATE TABLE `reservation_manga` (
  `id_reservation` int NOT NULL,
  `id_manga` int NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

--
-- Déchargement des données de la table `reservation_manga`
--

INSERT INTO `reservation_manga` (`id_reservation`, `id_manga`) VALUES
(91, 104),
(91, 105),
(92, 105),
(93, 104),
(93, 105),
(94, 79),
(94, 82),
(94, 104),
(95, 79),
(95, 84),
(95, 105),
(96, 90),
(96, 91),
(96, 104),
(97, 48),
(97, 68),
(97, 104),
(98, 48),
(98, 68),
(98, 90),
(98, 104),
(98, 113),
(99, 113),
(100, 113),
(101, 90),
(101, 104),
(101, 113),
(102, 90),
(103, 104),
(103, 113),
(104, 68),
(104, 104),
(105, 49),
(105, 113),
(106, 47),
(106, 48),
(107, 49),
(107, 113),
(108, 113),
(109, 49),
(110, 68),
(111, 49),
(111, 113),
(112, 49),
(113, 49),
(114, 47),
(115, 48),
(115, 90),
(115, 104),
(115, 113),
(116, 83),
(116, 84),
(117, 46),
(117, 115),
(118, 73),
(118, 115),
(119, 91),
(120, 46),
(120, 115),
(121, 46),
(121, 91),
(122, 46),
(122, 91),
(123, 46),
(123, 115),
(124, 46),
(124, 91),
(125, 46),
(125, 91),
(126, 46),
(126, 91),
(127, 115),
(128, 91),
(129, 115),
(130, 45),
(130, 46),
(130, 73),
(130, 91),
(130, 92),
(130, 115),
(131, 45),
(131, 46),
(131, 88),
(131, 89),
(131, 91),
(131, 92),
(131, 115),
(132, 73),
(132, 115),
(132, 116),
(133, 46),
(133, 115),
(133, 116);

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

--
-- Index pour la table `manga`
--
ALTER TABLE `manga`
  ADD PRIMARY KEY (`id_manga`),
  ADD KEY `id_genre` (`id_genre`);

--
-- Index pour la table `reservation`
--
ALTER TABLE `reservation`
  ADD PRIMARY KEY (`id_reservation`),
  ADD KEY `id_client` (`id_client`);

--
-- Index pour la table `reservation_manga`
--
ALTER TABLE `reservation_manga`
  ADD PRIMARY KEY (`id_manga`,`id_reservation`),
  ADD KEY `id_reservation` (`id_reservation`);

--
-- AUTO_INCREMENT pour la table `genre`
--
ALTER TABLE `genre`
  MODIFY `id_genre` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=11;

--
-- AUTO_INCREMENT pour la table `manga`
--
ALTER TABLE `manga`
  MODIFY `id_manga` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=117;

--
-- AUTO_INCREMENT pour la table `reservation`
--
ALTER TABLE `reservation`
  MODIFY `id_reservation` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=134;

--
-- Contraintes pour les tables déchargées
--

--
-- Contraintes pour la table `manga`
--
ALTER TABLE `manga`
  ADD CONSTRAINT `manga_ibfk_1` FOREIGN KEY (`id_genre`) REFERENCES `genre` (`id_genre`);

--
-- Contraintes pour la table `reservation`
--
ALTER TABLE `reservation`
  ADD CONSTRAINT `reservation_ibfk_1` FOREIGN KEY (`id_client`) REFERENCES `client` (`id_client`);

--
-- Contraintes pour la table `reservation_manga`
--
ALTER TABLE `reservation_manga`
  ADD CONSTRAINT `reservation_manga_ibfk_1` FOREIGN KEY (`id_manga`) REFERENCES `manga` (`id_manga`),
  ADD CONSTRAINT `reservation_manga_ibfk_2` FOREIGN KEY (`id_reservation`) REFERENCES `reservation` (`id_reservation`);
COMMIT;

