-- --------------------------------------------------------
-- Hôte:                         127.0.0.1
-- Version du serveur:           8.0.30 - MySQL Community Server - GPL
-- SE du serveur:                Win64
-- HeidiSQL Version:             12.1.0.6537
-- --------------------------------------------------------



-- Listage de la structure de la base pour session
CREATE DATABASE IF NOT EXISTS `session` /*!40100 DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci */ /*!80016 DEFAULT ENCRYPTION='N' */;
USE `session`;

-- Listage de la structure de table session. category
CREATE TABLE IF NOT EXISTS `category` (
  `id` int NOT NULL AUTO_INCREMENT,
  `name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=21 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- Listage des données de la table session.category : ~5 rows (environ)
INSERT INTO `category` (`id`, `name`) VALUES
	(1, 'Front-end'),
	(2, 'Back-end'),
	(3, 'Gestion de Projet'),
	(4, 'Microsoft Office'),
	(5, 'Marketing');

-- Listage de la structure de table session. course
CREATE TABLE IF NOT EXISTS `course` (
  `id` int NOT NULL AUTO_INCREMENT,
  `category_id` int NOT NULL,
  `name_course` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_169E6FB912469DE2` (`category_id`),
  CONSTRAINT `FK_169E6FB912469DE2` FOREIGN KEY (`category_id`) REFERENCES `category` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=23 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- Listage des données de la table session.course : ~18 rows (environ)
INSERT INTO `course` (`id`, `category_id`, `name_course`) VALUES
	(1, 1, 'HTML5 et CSS3'),
	(2, 1, 'Javascript'),
	(3, 1, 'Framework'),
	(4, 1, 'Accessibilité'),
	(5, 2, 'PHP'),
	(6, 2, 'MySQL'),
	(7, 2, 'Sécurité'),
	(8, 2, 'API'),
	(9, 3, 'Méthodologies Planification'),
	(10, 3, 'Gestion Trello'),
	(11, 3, 'Risques Qualité'),
	(12, 3, 'Communication'),
	(13, 4, 'Word'),
	(14, 4, 'Excel'),
	(15, 4, 'PowerPoint'),
	(16, 5, 'Fondements du marketing'),
	(17, 5, 'Stratégie de communication'),
	(18, 5, 'Marketing des médias sociaux');

-- Listage de la structure de table session. formation
CREATE TABLE IF NOT EXISTS `formation` (
  `id` int NOT NULL AUTO_INCREMENT,
  `name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- Listage des données de la table session.formation : ~3 rows (environ)
INSERT INTO `formation` (`id`, `name`) VALUES
	(1, 'Informatique et Technologie'),
	(2, 'Bureautique et Productivité'),
	(3, 'Marketing et Communication');

-- Listage de la structure de table session. messenger_messages
CREATE TABLE IF NOT EXISTS `messenger_messages` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `body` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `headers` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `queue_name` varchar(190) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` datetime NOT NULL COMMENT '(DC2Type:datetime_immutable)',
  `available_at` datetime NOT NULL COMMENT '(DC2Type:datetime_immutable)',
  `delivered_at` datetime DEFAULT NULL COMMENT '(DC2Type:datetime_immutable)',
  PRIMARY KEY (`id`),
  KEY `IDX_75EA56E0FB7336F0` (`queue_name`),
  KEY `IDX_75EA56E0E3BD61CE` (`available_at`),
  KEY `IDX_75EA56E016BA31DB` (`delivered_at`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- Listage de la structure de table session. session
CREATE TABLE IF NOT EXISTS `session` (
  `id` int NOT NULL AUTO_INCREMENT,
  `formation_id` int NOT NULL,
  `max_students` int NOT NULL,
  `date_start` datetime NOT NULL,
  `date_end` datetime NOT NULL,
  `reservations` int NOT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_D044D5D45200282E` (`formation_id`),
  CONSTRAINT `FK_D044D5D45200282E` FOREIGN KEY (`formation_id`) REFERENCES `formation` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- Listage des données de la table session.session : ~11 rows (environ)
INSERT INTO `session` (`id`, `formation_id`, `max_students`, `date_start`, `date_end`, `reservations`) VALUES
	(1, 1, 15, '2024-05-15 06:09:24', '2024-06-15 06:09:33', 0),
	(2, 2, 15, '2024-05-16 18:42:06', '2024-06-16 18:42:10', 0),
	(3, 3, 15, '2024-05-16 19:06:08', '2024-05-16 19:06:12', 0),
	(4, 1, 1, '2024-05-22 00:00:00', '2024-05-23 00:00:00', 0),
	(5, 1, 10, '2024-05-22 00:00:00', '2024-05-31 00:00:00', 10),
	(6, 1, 1, '2024-05-22 00:00:00', '2024-05-23 00:00:00', 1),
	(7, 2, 1, '2024-05-22 00:00:00', '2024-05-24 00:00:00', 1),
	(8, 3, 1, '2024-05-23 00:00:00', '2024-05-23 00:00:00', 1),
	(9, 1, 1, '2024-05-22 00:00:00', '2024-05-23 00:00:00', 1),
	(10, 1, 1, '2024-05-22 00:00:00', '2024-05-22 00:00:00', 1),
	(11, 3, 1, '2024-05-22 00:00:00', '2024-05-22 00:00:00', 1);

-- Listage de la structure de table session. student
CREATE TABLE IF NOT EXISTS `student` (
  `id` int NOT NULL AUTO_INCREMENT,
  `last_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `first_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `address` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `city` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `phone_number` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `birthday` datetime NOT NULL,
  `zip_code` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- Listage des données de la table session.student : ~7 rows (environ)
INSERT INTO `student` (`id`, `last_name`, `first_name`, `address`, `city`, `phone_number`, `birthday`, `zip_code`) VALUES
	(1, 'Wingard', 'Adam', '185 impasse des canards', 'Marseille', '07.01.69.54.10', '2024-05-13 15:49:19', '13000'),
	(2, 'Pratt', 'Chris', '5 rue de l\'étang', 'Lens', '06.09.15.75.85', '2024-05-13 15:50:10', '62000'),
	(3, 'Larson', 'Brie', '89 rue du Général de Gaule', 'Belfort\r\n', '03.88.10.52.32', '2024-05-13 15:51:12', '90000'),
	(4, 'Lawrence', 'Jennifer', '18 rue de strasbourg', 'Colmar', '03.89.82.86.10', '2024-05-19 08:36:16', '68000'),
	(7, 'Semoun', 'Elie', '26 rue cabourg', 'lille', '0789252488', '2024-05-04 00:00:00', '62000'),
	(8, 'Caen', 'Emilie', '100 rue de bordeaux', 'toulouse', '0600000203', '2024-05-26 00:00:00', '31000'),
	(9, 'MONTMIRAIL', 'ANTHONY', '5 rue de la libération', 'Thann', '0760504566', '2024-05-18 00:00:00', '68800');

-- Listage des données de la table session.user : ~0 rows (environ)

