-- MySQL dump 10.13  Distrib 9.4.0, for Linux (x86_64)
--
-- Host: localhost    Database: db
-- ------------------------------------------------------
-- Server version	9.4.0

/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!50503 SET NAMES utf8mb4 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;

--
-- Table structure for table `t_aeroport`
--

DROP TABLE IF EXISTS `t_aeroport`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `t_aeroport` (
  `aeroport_id` int NOT NULL AUTO_INCREMENT,
  `code_iata` char(3) DEFAULT NULL,
  `code_icao` char(4) DEFAULT NULL,
  `nom` varchar(50) DEFAULT NULL,
  PRIMARY KEY (`aeroport_id`),
  UNIQUE KEY `code_icao` (`code_icao`)
) ENGINE=InnoDB AUTO_INCREMENT=13598 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `t_avion`
--

DROP TABLE IF EXISTS `t_avion`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `t_avion` (
  `avion_id` int NOT NULL AUTO_INCREMENT,
  `capacite` int DEFAULT NULL,
  `compagnie_fk` int NOT NULL,
  `type_avion_fk` int NOT NULL,
  PRIMARY KEY (`avion_id`),
  KEY `compagnie_fk` (`compagnie_fk`),
  KEY `type_avion_fk` (`type_avion_fk`),
  CONSTRAINT `t_avion_ibfk_1` FOREIGN KEY (`compagnie_fk`) REFERENCES `t_compagnie` (`compagnie_id`),
  CONSTRAINT `t_avion_ibfk_2` FOREIGN KEY (`type_avion_fk`) REFERENCES `t_type_avion` (`type_avion_id`)
) ENGINE=InnoDB AUTO_INCREMENT=5582 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `t_compagnie`
--

DROP TABLE IF EXISTS `t_compagnie`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `t_compagnie` (
  `compagnie_id` int NOT NULL AUTO_INCREMENT,
  `code_iata` char(2) DEFAULT NULL,
  `nom` varchar(30) DEFAULT NULL,
  `aeroport_fk` int NOT NULL,
  PRIMARY KEY (`compagnie_id`),
  KEY `aeroport_fk` (`aeroport_fk`),
  CONSTRAINT `t_compagnie_ibfk_1` FOREIGN KEY (`aeroport_fk`) REFERENCES `t_aeroport` (`aeroport_id`)
) ENGINE=InnoDB AUTO_INCREMENT=114 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `t_passager`
--

DROP TABLE IF EXISTS `t_passager`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `t_passager` (
  `passager_id` int NOT NULL AUTO_INCREMENT,
  `numero_passeport` char(9) DEFAULT NULL,
  `nom` varchar(100) DEFAULT NULL,
  `prenom` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`passager_id`),
  UNIQUE KEY `numero_passeport` (`numero_passeport`)
) ENGINE=InnoDB AUTO_INCREMENT=36100 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `t_programme_vol`
--

DROP TABLE IF EXISTS `t_programme_vol`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `t_programme_vol` (
  `numero_vol` char(8) NOT NULL,
  `heure_depart` time DEFAULT NULL,
  `heure_arrivee` time DEFAULT NULL,
  `lundi` tinyint DEFAULT NULL,
  `mardi` tinyint DEFAULT NULL,
  `mercredi` tinyint DEFAULT NULL,
  `jeudi` tinyint DEFAULT NULL,
  `vendredi` tinyint DEFAULT NULL,
  `samedi` tinyint DEFAULT NULL,
  `dimanche` tinyint DEFAULT NULL,
  `compagnie_fk` int NOT NULL,
  `aeroport_arrivee_fk` int NOT NULL,
  `aeroport_depart_fk` int NOT NULL,
  PRIMARY KEY (`numero_vol`),
  KEY `compagnie_fk` (`compagnie_fk`),
  KEY `aeroport_arrivee_fk` (`aeroport_arrivee_fk`),
  KEY `aeroport_depart_fk` (`aeroport_depart_fk`),
  CONSTRAINT `t_programme_vol_ibfk_1` FOREIGN KEY (`compagnie_fk`) REFERENCES `t_compagnie` (`compagnie_id`),
  CONSTRAINT `t_programme_vol_ibfk_2` FOREIGN KEY (`aeroport_arrivee_fk`) REFERENCES `t_aeroport` (`aeroport_id`),
  CONSTRAINT `t_programme_vol_ibfk_3` FOREIGN KEY (`aeroport_depart_fk`) REFERENCES `t_aeroport` (`aeroport_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `t_reservation`
--

DROP TABLE IF EXISTS `t_reservation`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `t_reservation` (
  `reservation_id` int NOT NULL AUTO_INCREMENT,
  `siege` char(4) DEFAULT NULL,
  `prix` decimal(10,2) DEFAULT NULL,
  `passager_fk` int NOT NULL,
  `vol_fk` int NOT NULL,
  PRIMARY KEY (`reservation_id`),
  KEY `passager_fk` (`passager_fk`),
  KEY `vol_fk` (`vol_fk`),
  CONSTRAINT `t_reservation_ibfk_1` FOREIGN KEY (`passager_fk`) REFERENCES `t_passager` (`passager_id`),
  CONSTRAINT `t_reservation_ibfk_2` FOREIGN KEY (`vol_fk`) REFERENCES `t_vol` (`vol_id`)
) ENGINE=InnoDB AUTO_INCREMENT=7122275 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `t_type_avion`
--

DROP TABLE IF EXISTS `t_type_avion`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `t_type_avion` (
  `type_avion_id` int NOT NULL AUTO_INCREMENT,
  `nom` varchar(50) DEFAULT NULL,
  `description` text,
  PRIMARY KEY (`type_avion_id`)
) ENGINE=InnoDB AUTO_INCREMENT=343 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `t_vol`
--

DROP TABLE IF EXISTS `t_vol`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `t_vol` (
  `vol_id` int NOT NULL AUTO_INCREMENT,
  `heure_depart` time DEFAULT NULL,
  `heure_arrivee` time DEFAULT NULL,
  `avion_fk` int NOT NULL,
  `compagnie_fk` int NOT NULL,
  `aeroport_arrivee_fk` int NOT NULL,
  `aeroport_depart_fk` int NOT NULL,
  `numero_vol_fk` char(8) NOT NULL,
  PRIMARY KEY (`vol_id`),
  KEY `avion_fk` (`avion_fk`),
  KEY `compagnie_fk` (`compagnie_fk`),
  KEY `aeroport_arrivee_fk` (`aeroport_arrivee_fk`),
  KEY `aeroport_depart_fk` (`aeroport_depart_fk`),
  KEY `numero_vol_fk` (`numero_vol_fk`),
  CONSTRAINT `t_vol_ibfk_1` FOREIGN KEY (`avion_fk`) REFERENCES `t_avion` (`avion_id`),
  CONSTRAINT `t_vol_ibfk_2` FOREIGN KEY (`compagnie_fk`) REFERENCES `t_compagnie` (`compagnie_id`),
  CONSTRAINT `t_vol_ibfk_3` FOREIGN KEY (`aeroport_arrivee_fk`) REFERENCES `t_aeroport` (`aeroport_id`),
  CONSTRAINT `t_vol_ibfk_4` FOREIGN KEY (`aeroport_depart_fk`) REFERENCES `t_aeroport` (`aeroport_id`),
  CONSTRAINT `t_vol_ibfk_5` FOREIGN KEY (`numero_vol_fk`) REFERENCES `t_programme_vol` (`numero_vol`)
) ENGINE=InnoDB AUTO_INCREMENT=758663 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;

/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;

-- Dump completed on 2025-10-27 14:36:17
