0% found this document useful (0 votes)
18 views

C Formation

This document contains the SQL code to create a database schema called "c_formation" with several tables: formation, specialite, catalogue, etudiant, session, and inscription. The tables are related through foreign key constraints. The code first sets up the database environment before creating the tables and their columns, indexes, and foreign key relationships.

Uploaded by

Layadi Abdellah
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views

C Formation

This document contains the SQL code to create a database schema called "c_formation" with several tables: formation, specialite, catalogue, etudiant, session, and inscription. The tables are related through foreign key constraints. The code first sets up the database environment before creating the tables and their columns, indexes, and foreign key relationships.

Uploaded by

Layadi Abdellah
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 3

-- MySQL Workbench Forward Engineering

SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0;


SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0;
SET @OLD_SQL_MODE=@@SQL_MODE,
SQL_MODE='ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR
_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION';

-- -----------------------------------------------------
-- Schema mydb
-- -----------------------------------------------------
-- -----------------------------------------------------
-- Schema c_formation
-- -----------------------------------------------------

-- -----------------------------------------------------
-- Schema c_formation
-- -----------------------------------------------------
CREATE SCHEMA IF NOT EXISTS `c_formation` DEFAULT CHARACTER SET utf8mb4 COLLATE
utf8mb4_0900_ai_ci ;
USE `c_formation` ;

-- -----------------------------------------------------
-- Table `c_formation`.`formation`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `c_formation`.`formation` (
`codeForm` INT NOT NULL,
`titreForm` VARCHAR(30) NULL DEFAULT NULL,
`dureeForm` INT NULL DEFAULT NULL,
`prixForm` INT NULL DEFAULT NULL,
PRIMARY KEY (`codeForm`))
ENGINE = InnoDB
DEFAULT CHARACTER SET = utf8mb4
COLLATE = utf8mb4_0900_ai_ci;

-- -----------------------------------------------------
-- Table `c_formation`.`specialite`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `c_formation`.`specialite` (
`codeSpec` INT NOT NULL,
`nomSpec` VARCHAR(30) NULL DEFAULT NULL,
`descSpec` VARCHAR(100) NULL DEFAULT NULL,
`Active` TINYINT NULL DEFAULT NULL,
PRIMARY KEY (`codeSpec`))
ENGINE = InnoDB
DEFAULT CHARACTER SET = utf8mb4
COLLATE = utf8mb4_0900_ai_ci;

-- -----------------------------------------------------
-- Table `c_formation`.`catalogue`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `c_formation`.`catalogue` (
`CodeSpec` INT NOT NULL,
`codeForm` INT NOT NULL,
PRIMARY KEY (`CodeSpec`, `codeForm`),
INDEX `codeForm` (`codeForm` ASC) VISIBLE,
CONSTRAINT `catalogue_ibfk_1`
FOREIGN KEY (`codeForm`)
REFERENCES `c_formation`.`formation` (`codeForm`),
CONSTRAINT `catalogue_ibfk_2`
FOREIGN KEY (`CodeSpec`)
REFERENCES `c_formation`.`specialite` (`codeSpec`))
ENGINE = InnoDB
DEFAULT CHARACTER SET = utf8mb4
COLLATE = utf8mb4_0900_ai_ci;

-- -----------------------------------------------------
-- Table `c_formation`.`etudiant`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `c_formation`.`etudiant` (
`numCINEtu` VARCHAR(30) NOT NULL,
`nomEtu` VARCHAR(30) NULL DEFAULT NULL,
`prenomEtu` VARCHAR(30) NULL DEFAULT NULL,
`cataloguedateNaissance` DATE NULL DEFAULT NULL,
`adressEtu` VARCHAR(100) NULL DEFAULT NULL,
`villeEtu` VARCHAR(30) NULL DEFAULT NULL,
`niveauEtu` VARCHAR(30) NULL DEFAULT NULL,
PRIMARY KEY (`numCINEtu`))
ENGINE = InnoDB
DEFAULT CHARACTER SET = utf8mb4
COLLATE = utf8mb4_0900_ai_ci;

-- -----------------------------------------------------
-- Table `c_formation`.`session`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `c_formation`.`session` (
`codeSess` INT NOT NULL,
`nomSess` VARCHAR(30) NULL DEFAULT NULL,
`Datedebut` DATE NULL DEFAULT NULL,
`Datefin` DATE NULL DEFAULT NULL,
`codeform` INT NULL DEFAULT NULL,
PRIMARY KEY (`codeSess`),
INDEX `codeform` (`codeform` ASC) VISIBLE,
CONSTRAINT `session_ibfk_1`
FOREIGN KEY (`codeform`)
REFERENCES `c_formation`.`formation` (`codeForm`))
ENGINE = InnoDB
DEFAULT CHARACTER SET = utf8mb4
COLLATE = utf8mb4_0900_ai_ci;

-- -----------------------------------------------------
-- Table `c_formation`.`inscription`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `c_formation`.`inscription` (
`codeSess` INT NOT NULL,
`numCINEtu` VARCHAR(30) NOT NULL,
`TypeCours` VARCHAR(30) NULL DEFAULT NULL,
PRIMARY KEY (`codeSess`, `numCINEtu`),
INDEX `numCINEtu` (`numCINEtu` ASC) VISIBLE,
CONSTRAINT `inscription_ibfk_1`
FOREIGN KEY (`numCINEtu`)
REFERENCES `c_formation`.`etudiant` (`numCINEtu`),
CONSTRAINT `inscription_ibfk_2`
FOREIGN KEY (`codeSess`)
REFERENCES `c_formation`.`session` (`codeSess`))
ENGINE = InnoDB
DEFAULT CHARACTER SET = utf8mb4
COLLATE = utf8mb4_0900_ai_ci;

SET SQL_MODE=@OLD_SQL_MODE;
SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS;
SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS;

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy