-- phpMyAdmin SQL Dump
-- version 3.3.9.2
-- http://www.phpmyadmin.net
--
-- Serveur: localhost
-- Généré le : Dim 15 Janvier 2012 à 21:57
-- Version du serveur: 5.5.9
-- Version de PHP: 5.3.6

SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";


/*!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 */;
/*!40101 SET NAMES utf8 */;

--
-- Base de données: `Entreprise`
--
CREATE DATABASE `Entreprise` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
USE `Entreprise`;

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

--
-- Structure de la table `APPARTENANCE`
--

CREATE TABLE `APPARTENANCE` (
  `EmployeID` int(11) NOT NULL,
  `ProjetID` int(11) NOT NULL,
  `Taux_participation` float NOT NULL,
  PRIMARY KEY (`EmployeID`,`ProjetID`),
  KEY `ProjetID` (`ProjetID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Contenu de la table `APPARTENANCE`
--

INSERT INTO `APPARTENANCE` VALUES(1, 1, 0.6);
INSERT INTO `APPARTENANCE` VALUES(1, 2, 0.3);
INSERT INTO `APPARTENANCE` VALUES(2, 1, 0.7);
INSERT INTO `APPARTENANCE` VALUES(2, 2, 0.2);
INSERT INTO `APPARTENANCE` VALUES(3, 1, 0.2);
INSERT INTO `APPARTENANCE` VALUES(3, 2, 0.7);
INSERT INTO `APPARTENANCE` VALUES(4, 2, 0.9);
INSERT INTO `APPARTENANCE` VALUES(5, 1, 0.9);
INSERT INTO `APPARTENANCE` VALUES(7, 1, 0.1);
INSERT INTO `APPARTENANCE` VALUES(7, 2, 0.8);
INSERT INTO `APPARTENANCE` VALUES(8, 2, 0.7);
INSERT INTO `APPARTENANCE` VALUES(9, 1, 0.6);

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

--
-- Structure de la table `DEPARTEMENT`
--

CREATE TABLE `DEPARTEMENT` (
  `DepartementID` int(11) NOT NULL AUTO_INCREMENT,
  `Description` varchar(30) NOT NULL,
  `ChefDepID` int(11) NOT NULL,
  PRIMARY KEY (`DepartementID`),
  KEY `ChefDepID` (`ChefDepID`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 AUTO_INCREMENT=7 ;

--
-- Contenu de la table `DEPARTEMENT`
--

INSERT INTO `DEPARTEMENT` VALUES(3, 'Informatique', 2);
INSERT INTO `DEPARTEMENT` VALUES(5, 'Personnel', 3);
INSERT INTO `DEPARTEMENT` VALUES(6, 'Finances', 1);

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

--
-- Structure de la table `EMPLOYE`
--

CREATE TABLE `EMPLOYE` (
  `EmployeID` int(11) NOT NULL AUTO_INCREMENT,
  `Nom` varchar(30) NOT NULL,
  `Rue` varchar(60) NOT NULL,
  `Ville` varchar(30) NOT NULL,
  `AffectationID` int(11) NOT NULL,
  PRIMARY KEY (`EmployeID`),
  KEY `AffectationID` (`AffectationID`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 AUTO_INCREMENT=14 ;

--
-- Contenu de la table `EMPLOYE`
--

INSERT INTO `EMPLOYE` VALUES(1, 'Savoy', 'Avenue de la Gare', 'Romont', 6);
INSERT INTO `EMPLOYE` VALUES(2, 'Meier', 'Rue Faucigny', 'Fribourg', 3);
INSERT INTO `EMPLOYE` VALUES(3, 'Humbert', 'Route des Alpes', 'Bulle', 5);
INSERT INTO `EMPLOYE` VALUES(4, 'Brodard', 'Rue du Tilleul', 'Fribourg', 6);
INSERT INTO `EMPLOYE` VALUES(5, 'Koller', 'Place Python 23', 'Fribourg', 3);
INSERT INTO `EMPLOYE` VALUES(6, 'Gremaud', 'Rue de la Léchère 56', 'Bulle', 3);
INSERT INTO `EMPLOYE` VALUES(7, 'Künzli', 'Beauregard 34', 'Fribourg', 5);
INSERT INTO `EMPLOYE` VALUES(8, 'Clément', 'Grand Rue 14', 'Bulle', 6);
INSERT INTO `EMPLOYE` VALUES(9, 'Farage', 'Route de Montreux 43', 'Châtel-Saint-Denis', 3);
INSERT INTO `EMPLOYE` VALUES(10, 'Cosandey', 'Route de la Gruyère 14', 'Fribourg', 3);

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

--
-- Structure de la table `PROJET`
--

CREATE TABLE `PROJET` (
  `ProjetID` int(11) NOT NULL AUTO_INCREMENT,
  `Contenu` varchar(150) NOT NULL,
  PRIMARY KEY (`ProjetID`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 AUTO_INCREMENT=3 ;

--
-- Contenu de la table `PROJET`
--

INSERT INTO `PROJET` VALUES(1, 'Gestion site HC Fribourg Gottéron');
INSERT INTO `PROJET` VALUES(2, 'Planification horaire 2012');

--
-- Contraintes pour les tables exportées
--

--
-- Contraintes pour la table `APPARTENANCE`
--
ALTER TABLE `APPARTENANCE`
  ADD CONSTRAINT `APPARTENANCE_ibfk_2` FOREIGN KEY (`ProjetID`) REFERENCES `PROJET` (`ProjetID`) ON DELETE CASCADE,
  ADD CONSTRAINT `APPARTENANCE_ibfk_1` FOREIGN KEY (`EmployeID`) REFERENCES `EMPLOYE` (`EmployeID`) ON DELETE CASCADE;

--
-- Contraintes pour la table `DEPARTEMENT`
--
ALTER TABLE `DEPARTEMENT`
  ADD CONSTRAINT `DEPARTEMENT_ibfk_1` FOREIGN KEY (`ChefDepID`) REFERENCES `EMPLOYE` (`EmployeID`);

--
-- Contraintes pour la table `EMPLOYE`
--
ALTER TABLE `EMPLOYE`
  ADD CONSTRAINT `EMPLOYE_ibfk_1` FOREIGN KEY (`AffectationID`) REFERENCES `DEPARTEMENT` (`DepartementID`);
