|
|
|
@ -2,297 +2,53 @@ |
|
|
|
|
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'; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
CREATE SCHEMA IF NOT EXISTS `collaborateur_epa` DEFAULT CHARACTER SET latin1 ; |
|
|
|
|
USE `collaborateur_epa` ; |
|
|
|
|
|
|
|
|
|
-- ----------------------------------------------------- |
|
|
|
|
-- Table `collaborateur_epa`.`agence` |
|
|
|
|
-- ----------------------------------------------------- |
|
|
|
|
CREATE TABLE IF NOT EXISTS `collaborateur_epa`.`agence` ( |
|
|
|
|
`Id` INT NOT NULL AUTO_INCREMENT, |
|
|
|
|
`Name` VARCHAR(100) NOT NULL, |
|
|
|
|
PRIMARY KEY (`Id`), |
|
|
|
|
UNIQUE INDEX `Name` (`Name` ASC) VISIBLE) |
|
|
|
|
ENGINE = InnoDB |
|
|
|
|
AUTO_INCREMENT = 5 |
|
|
|
|
DEFAULT CHARACTER SET = latin1; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-- ----------------------------------------------------- |
|
|
|
|
-- Table `collaborateur_epa`.`businessunit` |
|
|
|
|
-- ----------------------------------------------------- |
|
|
|
|
CREATE TABLE IF NOT EXISTS `collaborateur_epa`.`businessunit` ( |
|
|
|
|
`Id` INT NOT NULL AUTO_INCREMENT, |
|
|
|
|
`Name` VARCHAR(100) NOT NULL, |
|
|
|
|
`AgenceId` INT NOT NULL, |
|
|
|
|
PRIMARY KEY (`Id`), |
|
|
|
|
UNIQUE INDEX `Name` (`Name` ASC) VISIBLE, |
|
|
|
|
INDEX `FK_BUSINESS_UNIT_AGENCE` (`AgenceId` ASC) VISIBLE, |
|
|
|
|
CONSTRAINT `FK_BUSINESS_UNIT_AGENCE` |
|
|
|
|
FOREIGN KEY (`AgenceId`) |
|
|
|
|
REFERENCES `collaborateur_epa`.`agence` (`Id`)) |
|
|
|
|
ENGINE = InnoDB |
|
|
|
|
AUTO_INCREMENT = 2 |
|
|
|
|
DEFAULT CHARACTER SET = latin1; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-- ----------------------------------------------------- |
|
|
|
|
-- Table `collaborateur_epa`.`collaborateur` |
|
|
|
|
-- ----------------------------------------------------- |
|
|
|
|
CREATE TABLE IF NOT EXISTS `collaborateur_epa`.`collaborateur` ( |
|
|
|
|
`Id` INT NOT NULL AUTO_INCREMENT, |
|
|
|
|
`Name` VARCHAR(100) NOT NULL, |
|
|
|
|
`FirstName` VARCHAR(100) NOT NULL, |
|
|
|
|
`BirthDate` DATE NOT NULL, |
|
|
|
|
`Gender` ENUM('masculin', 'feminin', 'autre') NOT NULL DEFAULT 'masculin', |
|
|
|
|
`Status` ENUM('cadre', 'noncadre', 'alternant', 'stagiaire') NOT NULL DEFAULT 'noncadre', |
|
|
|
|
`ChildrenNumber` INT NOT NULL, |
|
|
|
|
`Address` VARCHAR(200) NOT NULL, |
|
|
|
|
`Telephone` VARCHAR(15) NOT NULL, |
|
|
|
|
`PersonalMail` VARCHAR(100) NOT NULL, |
|
|
|
|
`ApsideMail` VARCHAR(100) NOT NULL, |
|
|
|
|
`ResignationDate` DATE NULL DEFAULT NULL, |
|
|
|
|
`BusinessUnitId` INT NOT NULL, |
|
|
|
|
`ReferrerId` INT NULL DEFAULT NULL, |
|
|
|
|
PRIMARY KEY (`Id`), |
|
|
|
|
INDEX `FK_COLLABORATEUR_BUSINESSUNIT` (`BusinessUnitId` ASC) VISIBLE, |
|
|
|
|
INDEX `FK_COLLABORATEUR_PARRAIN` (`ReferrerId` ASC) VISIBLE, |
|
|
|
|
CONSTRAINT `FK_COLLABORATEUR_BUSINESSUNIT` |
|
|
|
|
FOREIGN KEY (`BusinessUnitId`) |
|
|
|
|
REFERENCES `collaborateur_epa`.`businessunit` (`Id`), |
|
|
|
|
CONSTRAINT `FK_COLLABORATEUR_PARRAIN` |
|
|
|
|
FOREIGN KEY (`ReferrerId`) |
|
|
|
|
REFERENCES `collaborateur_epa`.`collaborateur` (`Id`)) |
|
|
|
|
ENGINE = InnoDB |
|
|
|
|
AUTO_INCREMENT = 13 |
|
|
|
|
DEFAULT CHARACTER SET = latin1; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-- ----------------------------------------------------- |
|
|
|
|
-- Table `collaborateur_epa`.`collaborateurappartientbusinessunit` |
|
|
|
|
-- ----------------------------------------------------- |
|
|
|
|
CREATE TABLE IF NOT EXISTS `collaborateur_epa`.`collaborateurappartientbusinessunit` ( |
|
|
|
|
`CollaborateurId` INT NOT NULL, |
|
|
|
|
`BusinessUnitId` INT NOT NULL, |
|
|
|
|
PRIMARY KEY (`CollaborateurId`, `BusinessUnitId`), |
|
|
|
|
INDEX `FK_BUSINESS_UNIT_COLLABORATEUR` (`BusinessUnitId` ASC) VISIBLE, |
|
|
|
|
CONSTRAINT `FK_BUSINESS_UNIT_COLLABORATEUR` |
|
|
|
|
FOREIGN KEY (`BusinessUnitId`) |
|
|
|
|
REFERENCES `collaborateur_epa`.`businessunit` (`Id`), |
|
|
|
|
CONSTRAINT `FK_COLLABORATEUR_BUSINESS_UNIT` |
|
|
|
|
FOREIGN KEY (`CollaborateurId`) |
|
|
|
|
REFERENCES `collaborateur_epa`.`collaborateur` (`Id`)) |
|
|
|
|
ENGINE = InnoDB |
|
|
|
|
DEFAULT CHARACTER SET = latin1; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-- ----------------------------------------------------- |
|
|
|
|
-- Table `collaborateur_epa`.`projet` |
|
|
|
|
-- ----------------------------------------------------- |
|
|
|
|
CREATE TABLE IF NOT EXISTS `collaborateur_epa`.`projet` ( |
|
|
|
|
`Id` INT NOT NULL AUTO_INCREMENT, |
|
|
|
|
`Name` VARCHAR(100) NOT NULL, |
|
|
|
|
`Client` VARCHAR(100) NOT NULL, |
|
|
|
|
`Description` VARCHAR(100) NOT NULL, |
|
|
|
|
`StartingDate` DATE NOT NULL, |
|
|
|
|
`EndingDate` DATE NOT NULL, |
|
|
|
|
PRIMARY KEY (`Id`), |
|
|
|
|
UNIQUE INDEX `Name` (`Name` ASC) VISIBLE) |
|
|
|
|
ENGINE = InnoDB |
|
|
|
|
DEFAULT CHARACTER SET = latin1; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-- ----------------------------------------------------- |
|
|
|
|
-- Table `collaborateur_epa`.`collaborateurcollaboreprojet` |
|
|
|
|
-- ----------------------------------------------------- |
|
|
|
|
CREATE TABLE IF NOT EXISTS `collaborateur_epa`.`collaborateurcollaboreprojet` ( |
|
|
|
|
`CollaborateurId` INT NOT NULL, |
|
|
|
|
`ProjetId` INT NOT NULL, |
|
|
|
|
`isManager` TINYINT(1) NOT NULL, |
|
|
|
|
PRIMARY KEY (`CollaborateurId`, `ProjetId`), |
|
|
|
|
INDEX `FK_PROJET_COLLABORE_COLLABORATEUR` (`ProjetId` ASC) VISIBLE, |
|
|
|
|
CONSTRAINT `FK_COLLABORATEUR_COLLABORE_PROJET` |
|
|
|
|
FOREIGN KEY (`CollaborateurId`) |
|
|
|
|
REFERENCES `collaborateur_epa`.`collaborateur` (`Id`), |
|
|
|
|
CONSTRAINT `FK_PROJET_COLLABORE_COLLABORATEUR` |
|
|
|
|
FOREIGN KEY (`ProjetId`) |
|
|
|
|
REFERENCES `collaborateur_epa`.`projet` (`Id`)) |
|
|
|
|
ENGINE = InnoDB |
|
|
|
|
DEFAULT CHARACTER SET = latin1; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-- ----------------------------------------------------- |
|
|
|
|
-- Table `collaborateur_epa`.`periodeessai` |
|
|
|
|
-- ----------------------------------------------------- |
|
|
|
|
CREATE TABLE IF NOT EXISTS `collaborateur_epa`.`periodeessai` ( |
|
|
|
|
`Id` INT NOT NULL AUTO_INCREMENT, |
|
|
|
|
`StartingDate` DATE NOT NULL, |
|
|
|
|
`PlannedEndingDate` DATE NOT NULL, |
|
|
|
|
`RealEndingDate` DATE NOT NULL, |
|
|
|
|
`Comment` VARCHAR(100) NOT NULL, |
|
|
|
|
`Issue` ENUM('VALIDEE', 'PROLONGEE_COLLAB', 'PROLONGEE_APSIDE', 'ARRETEE_COLLAB', 'ARRETEE_APSIDE') NOT NULL, |
|
|
|
|
`CollaborateurId` INT NOT NULL, |
|
|
|
|
PRIMARY KEY (`Id`), |
|
|
|
|
INDEX `FK_COLLABORATEUR_PERIODEESSAI` (`CollaborateurId` ASC) VISIBLE, |
|
|
|
|
CONSTRAINT `FK_COLLABORATEUR_PERIODEESSAI` |
|
|
|
|
FOREIGN KEY (`CollaborateurId`) |
|
|
|
|
REFERENCES `collaborateur_epa`.`collaborateur` (`Id`)) |
|
|
|
|
ENGINE = InnoDB |
|
|
|
|
DEFAULT CHARACTER SET = latin1; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-- ----------------------------------------------------- |
|
|
|
|
-- Table `collaborateur_epa`.`collaborateureffectueperiodeessai` |
|
|
|
|
-- ----------------------------------------------------- |
|
|
|
|
CREATE TABLE IF NOT EXISTS `collaborateur_epa`.`collaborateureffectueperiodeessai` ( |
|
|
|
|
`CollaborateurId` INT NOT NULL, |
|
|
|
|
`PeriodeEssaiId` INT NOT NULL, |
|
|
|
|
PRIMARY KEY (`CollaborateurId`, `PeriodeEssaiId`), |
|
|
|
|
INDEX `FK_PERIODE_ESSAI_COLLABORATEUR` (`PeriodeEssaiId` ASC) VISIBLE, |
|
|
|
|
CONSTRAINT `FK_COLLABORATEUR_PERIODE_ESSAI` |
|
|
|
|
FOREIGN KEY (`CollaborateurId`) |
|
|
|
|
REFERENCES `collaborateur_epa`.`collaborateur` (`Id`), |
|
|
|
|
CONSTRAINT `FK_PERIODE_ESSAI_COLLABORATEUR` |
|
|
|
|
FOREIGN KEY (`PeriodeEssaiId`) |
|
|
|
|
REFERENCES `collaborateur_epa`.`periodeessai` (`Id`)) |
|
|
|
|
ENGINE = InnoDB |
|
|
|
|
DEFAULT CHARACTER SET = latin1; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-- ----------------------------------------------------- |
|
|
|
|
-- Table `collaborateur_epa`.`fonction` |
|
|
|
|
-- ----------------------------------------------------- |
|
|
|
|
CREATE TABLE IF NOT EXISTS `collaborateur_epa`.`fonction` ( |
|
|
|
|
`Id` INT NOT NULL, |
|
|
|
|
`intitule` VARCHAR(100) NOT NULL, |
|
|
|
|
PRIMARY KEY (`Id`), |
|
|
|
|
UNIQUE INDEX `Id` (`Id` ASC) VISIBLE, |
|
|
|
|
UNIQUE INDEX `intitule` (`intitule` ASC) VISIBLE) |
|
|
|
|
ENGINE = InnoDB |
|
|
|
|
DEFAULT CHARACTER SET = latin1; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-- ----------------------------------------------------- |
|
|
|
|
-- Table `collaborateur_epa`.`collaborateurestfonction` |
|
|
|
|
-- ----------------------------------------------------- |
|
|
|
|
CREATE TABLE IF NOT EXISTS `collaborateur_epa`.`collaborateurestfonction` ( |
|
|
|
|
`CollaborateurId` INT NOT NULL, |
|
|
|
|
`FonctionId` INT NOT NULL, |
|
|
|
|
PRIMARY KEY (`CollaborateurId`, `FonctionId`), |
|
|
|
|
INDEX `FK_FONCTION_COLLABORATEUR` (`FonctionId` ASC) VISIBLE, |
|
|
|
|
CONSTRAINT `FK_COLLABORATEUR_FONCTION` |
|
|
|
|
FOREIGN KEY (`CollaborateurId`) |
|
|
|
|
REFERENCES `collaborateur_epa`.`collaborateur` (`Id`), |
|
|
|
|
CONSTRAINT `FK_FONCTION_COLLABORATEUR` |
|
|
|
|
FOREIGN KEY (`FonctionId`) |
|
|
|
|
REFERENCES `collaborateur_epa`.`fonction` (`Id`)) |
|
|
|
|
ENGINE = InnoDB |
|
|
|
|
DEFAULT CHARACTER SET = latin1; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-- ----------------------------------------------------- |
|
|
|
|
-- Table `collaborateur_epa`.`technologie` |
|
|
|
|
-- ----------------------------------------------------- |
|
|
|
|
CREATE TABLE IF NOT EXISTS `collaborateur_epa`.`technologie` ( |
|
|
|
|
`Id` INT NOT NULL, |
|
|
|
|
`Name` VARCHAR(100) NOT NULL, |
|
|
|
|
PRIMARY KEY (`Id`), |
|
|
|
|
UNIQUE INDEX `Id` (`Id` ASC) VISIBLE, |
|
|
|
|
UNIQUE INDEX `Name` (`Name` ASC) VISIBLE) |
|
|
|
|
ENGINE = InnoDB |
|
|
|
|
DEFAULT CHARACTER SET = latin1; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-- ----------------------------------------------------- |
|
|
|
|
-- Table `collaborateur_epa`.`projetutilisetechnologie` |
|
|
|
|
-- ----------------------------------------------------- |
|
|
|
|
CREATE TABLE IF NOT EXISTS `collaborateur_epa`.`projetutilisetechnologie` ( |
|
|
|
|
`ProjetId` INT NOT NULL, |
|
|
|
|
`TechnologieId` INT NOT NULL, |
|
|
|
|
PRIMARY KEY (`ProjetId`, `TechnologieId`), |
|
|
|
|
INDEX `FK_TECHNOLOGIE_PROJET` (`TechnologieId` ASC) VISIBLE, |
|
|
|
|
CONSTRAINT `FK_PROJET_TECHNOLOGIE` |
|
|
|
|
FOREIGN KEY (`ProjetId`) |
|
|
|
|
REFERENCES `collaborateur_epa`.`projet` (`Id`), |
|
|
|
|
CONSTRAINT `FK_TECHNOLOGIE_PROJET` |
|
|
|
|
FOREIGN KEY (`TechnologieId`) |
|
|
|
|
REFERENCES `collaborateur_epa`.`technologie` (`Id`)) |
|
|
|
|
ENGINE = InnoDB |
|
|
|
|
DEFAULT CHARACTER SET = latin1; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-- ----------------------------------------------------- |
|
|
|
|
-- Table `collaborateur_epa`.`referencement` |
|
|
|
|
-- ----------------------------------------------------- |
|
|
|
|
CREATE TABLE IF NOT EXISTS `collaborateur_epa`.`referencement` ( |
|
|
|
|
`Id` INT NOT NULL AUTO_INCREMENT, |
|
|
|
|
`StartingDate` DATE NOT NULL, |
|
|
|
|
`EndingDate` DATE NOT NULL, |
|
|
|
|
`ReferredId` INT NOT NULL, |
|
|
|
|
`ReferrerId` INT NOT NULL, |
|
|
|
|
PRIMARY KEY (`Id`), |
|
|
|
|
INDEX `FK_COLLABORATEUR_REFERE` (`ReferredId` ASC) VISIBLE, |
|
|
|
|
INDEX `FK_COLLABORATEUR_REFERENT` (`ReferrerId` ASC) VISIBLE, |
|
|
|
|
CONSTRAINT `FK_COLLABORATEUR_REFERE` |
|
|
|
|
FOREIGN KEY (`ReferredId`) |
|
|
|
|
REFERENCES `collaborateur_epa`.`collaborateur` (`Id`), |
|
|
|
|
CONSTRAINT `FK_COLLABORATEUR_REFERENT` |
|
|
|
|
FOREIGN KEY (`ReferrerId`) |
|
|
|
|
REFERENCES `collaborateur_epa`.`collaborateur` (`Id`)) |
|
|
|
|
ENGINE = InnoDB |
|
|
|
|
DEFAULT CHARACTER SET = latin1; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-- ----------------------------------------------------- |
|
|
|
|
-- Table `collaborateur_epa`.`site` |
|
|
|
|
-- ----------------------------------------------------- |
|
|
|
|
CREATE TABLE IF NOT EXISTS `collaborateur_epa`.`site` ( |
|
|
|
|
`Id` INT NOT NULL AUTO_INCREMENT, |
|
|
|
|
`Name` VARCHAR(100) NOT NULL, |
|
|
|
|
`Address` VARCHAR(200) NOT NULL, |
|
|
|
|
`BusinessUnitId` INT NOT NULL, |
|
|
|
|
PRIMARY KEY (`Id`), |
|
|
|
|
UNIQUE INDEX `Name` (`Name` ASC) VISIBLE, |
|
|
|
|
INDEX `FK_SITE_BUSINESS_UNIT` (`BusinessUnitId` ASC) VISIBLE, |
|
|
|
|
CONSTRAINT `FK_SITE_BUSINESS_UNIT` |
|
|
|
|
FOREIGN KEY (`BusinessUnitId`) |
|
|
|
|
REFERENCES `collaborateur_epa`.`businessunit` (`Id`)) |
|
|
|
|
ENGINE = InnoDB |
|
|
|
|
DEFAULT CHARACTER SET = latin1; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-- ----------------------------------------------------- |
|
|
|
|
-- Table `collaborateur_epa`.`sitedeveloppeprojet` |
|
|
|
|
-- ----------------------------------------------------- |
|
|
|
|
CREATE TABLE IF NOT EXISTS `collaborateur_epa`.`sitedeveloppeprojet` ( |
|
|
|
|
`SiteId` INT NOT NULL, |
|
|
|
|
`ProjetId` INT NOT NULL, |
|
|
|
|
PRIMARY KEY (`SiteId`, `ProjetId`), |
|
|
|
|
INDEX `FK_PROJET_SITE` (`ProjetId` ASC) VISIBLE, |
|
|
|
|
CONSTRAINT `FK_PROJET_SITE` |
|
|
|
|
FOREIGN KEY (`ProjetId`) |
|
|
|
|
REFERENCES `collaborateur_epa`.`projet` (`Id`), |
|
|
|
|
CONSTRAINT `FK_SITE_PROJET` |
|
|
|
|
FOREIGN KEY (`SiteId`) |
|
|
|
|
REFERENCES `collaborateur_epa`.`site` (`Id`)) |
|
|
|
|
ENGINE = InnoDB |
|
|
|
|
DEFAULT CHARACTER SET = latin1; |
|
|
|
|
|
|
|
|
|
INSERT INTO agence (Name) VALUES |
|
|
|
|
('Clermont-Ferrand'), |
|
|
|
|
('TOP'); |
|
|
|
|
|
|
|
|
|
Insert INTO businessunit (Name,AgenceId) VALUES |
|
|
|
|
('Cournon',1), |
|
|
|
|
('Tours',2), |
|
|
|
|
('Orléans',2), |
|
|
|
|
('Poitiers',2); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Insert INTO collaborateur (Name,FirstName,BirthDate,ChildrenNumber,Address,Telephone,PersonalMail,ApsideMail,ResignationDate,BusinessUnitId) |
|
|
|
|
Values ('Dupont','Marie','1990-04-04',0,'adresse','0660258644','perso@mail','apside@mail','2030-06-06',2); |
|
|
|
|
|
|
|
|
|
DROP DATABASE IF EXISTS collaborateur_epa; |
|
|
|
|
CREATE DATABASE IF NOT EXISTS collaborateur_epa /*!40100 DEFAULT CHARACTER SET latin1 */; |
|
|
|
|
USE collaborateur_epa; |
|
|
|
|
|
|
|
|
|
DROP TABLE IF EXISTS agence; |
|
|
|
|
CREATE TABLE IF NOT EXISTS agence( |
|
|
|
|
Id int NOT NULL AUTO_INCREMENT, |
|
|
|
|
Name varchar(100) NOT NULL UNIQUE, |
|
|
|
|
PRIMARY KEY (Id) |
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
DROP TABLE IF EXISTS businessunit; |
|
|
|
|
CREATE TABLE IF NOT EXISTS businessunit( |
|
|
|
|
Id int NOT NULL AUTO_INCREMENT, |
|
|
|
|
Name varchar(100) NOT NULL UNIQUE, |
|
|
|
|
agenceId int NOT NULL, |
|
|
|
|
CONSTRAINT FK_BUSINESS_UNIT_AGENCE FOREIGN KEY (agenceId) references agence(Id), |
|
|
|
|
PRIMARY KEY (Id) |
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
DROP TABLE IF EXISTS collaborateur; |
|
|
|
|
CREATE TABLE IF NOT EXISTS collaborateur( |
|
|
|
|
Id int NOT NULL AUTO_INCREMENT, |
|
|
|
|
Name varchar(100) NOT NULL, |
|
|
|
|
FirstName varchar(100) NOT NULL, |
|
|
|
|
BirthDate date NOT NULL, |
|
|
|
|
Gender ENUM('masculin','feminin','autre') NOT NULL DEFAULT 'masculin', |
|
|
|
|
Status ENUM('cadre','noncadre','alternant','stagiaire') NOT NULL DEFAULT 'noncadre', |
|
|
|
|
ChildrenNumber smallint NOT NULL, |
|
|
|
|
Address varchar(200) NOT NULL, |
|
|
|
|
Telephone varchar(15) NOT NULL, |
|
|
|
|
PersonalMail varchar(100) NOT NULL, |
|
|
|
|
ApsideMail varchar(100) NOT NULL, |
|
|
|
|
ResignationDate date, |
|
|
|
|
businessunitId int NOT NUll, |
|
|
|
|
ReferrerId int, |
|
|
|
|
CONSTRAINT FK_COLLABORATEUR_BUSINESSUNIT FOREIGN KEY (businessunitId) REFERENCES businessunit(Id), |
|
|
|
|
CONSTRAINT FK_COLLABORATEUR_PARRAIN FOREIGN KEY (ReferrerId) REFERENCES collaborateur(Id), |
|
|
|
|
PRIMARY KEY (Id) |
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
INSERT INTO agence(Id, Name) VALUES (1,'Clermont-Ferrand'); |
|
|
|
|
INSERT INTO businessunit(Id, Name, agenceId) VALUES (1,'Cournon',1); |
|
|
|
|
INSERT INTO collaborateur(Name, FirstName, BirthDate, Gender, Status, ChildrenNumber, Address, Telephone, PersonalMail, |
|
|
|
|
ApsideMail, ResignationDate, businessunitId, ReferrerId) |
|
|
|
|
VALUES ('Dupont','Marie','1990-08-08','feminin','cadre',0,'adresse','tel','pmail','amail','2030-08-08',1,1); |
|
|
|
|
|
|
|
|
|
SET SQL_MODE=@OLD_SQL_MODE; |
|
|
|
|
SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS; |
|
|
|
|