-- phpMyAdmin SQL Dump
-- version 3.3.9
-- http://www.phpmyadmin.net
--
-- Serveur: localhost
-- Généré le : Dim 09 Octobre 2011 à 19:50
-- Version du serveur: 5.5.8
-- Version de PHP: 5.3.5

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: `etudiants`
--

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

--
-- Structure de la table `enseignant`
--

CREATE TABLE IF NOT EXISTS `Uenseignant` (
  `numens` int(3) NOT NULL,
  `nomens` varchar(20) NOT NULL,
  `grade` varchar(5) NOT NULL,
  `ancien` int(2) NOT NULL,
  PRIMARY KEY (`numens`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Contenu de la table `enseignant`
--

INSERT INTO `Uenseignant` (`numens`, `nomens`, `grade`, `ancien`) VALUES
(1, 'ALAMELAMAT', 'maitr', 3),
(2, 'ARESE', 'assis', 13),
(3, 'BERKANI', 'maitr', 6),
(4, 'BOUSMAN', 'assis', 1),
(5, 'CALETI', 'maitr', 7),
(6, 'CARIOT', 'assis', 2),
(7, 'CASSEAU', 'maitr', 2),
(8, 'DUPONT', 'assis', 5),
(9, 'FABIATO', 'maitr', 3),
(10, 'FOULON', 'assis', 1),
(11, 'GASPERIC', 'maitr', 2),
(12, 'GERMANI', 'assis', 14),
(13, 'KUPERMAN', 'maitr', 5),
(14, 'LAM', 'assis', 7),
(15, 'LEHOUX', 'maitr', 3),
(16, 'LUNARDI', 'maitr', 1),
(17, 'MAILLOT', 'assis', 2),
(18, 'REMY', 'assis', 4);

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

--
-- Structure de la table `etudiant`
--

CREATE TABLE IF NOT EXISTS `Uetudiant` (
  `numetu` int(4) NOT NULL,
  `nometu` varchar(20) NOT NULL,
  `dtnaiss` date NOT NULL,
  `cdsexe` varchar(1) NOT NULL,
  PRIMARY KEY (`numetu`),
  KEY `cdsexe` (`cdsexe`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Contenu de la table `etudiant`
--

INSERT INTO `Uetudiant` (`numetu`, `nometu`, `dtnaiss`, `cdsexe`) VALUES
(1, 'DUPONT', '1990-01-12', 'M'),
(2, 'DURAND', '1995-12-14', 'M'),
(3, 'DUGENOU', '1988-11-06', 'F'),
(4, 'DULAC', '1988-05-14', 'M'),
(5, 'DUPARC', '1990-04-16', 'F'),
(6, 'DUMAS', '1990-09-05', 'F'),
(7, 'DUPOND', '1989-10-24', 'F'),
(8, 'DUMONT', '1987-08-30', 'F'),
(9, 'DUGAS', '1986-08-23', 'M'),
(10, 'DUCROS', '1989-11-27', 'M'),
(11, 'DUBOURG', '1991-09-19', 'M'),
(12, 'DUFRESNE', '1992-05-26', 'F'),
(13, 'DUJARDIN', '1990-04-21', 'F'),
(14, 'DUBON', '1988-06-25', 'M'),
(15, 'DUCASSE', '1989-09-10', 'M'),
(16, 'DUMESNIL', '1990-05-03', 'F'),
(17, 'DUMOULIN', '1989-04-04', 'M'),
(18, 'DULONG', '1991-10-12', 'F'),
(19, 'DUCOURT', '1990-03-16', 'F');

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

--
-- Structure de la table `matiere`
--

CREATE TABLE IF NOT EXISTS `Umatiere` (
  `numat` varchar(3) NOT NULL,
  `nomat` varchar(20) NOT NULL,
  `coeff` int(1) NOT NULL,
  `numens` int(3) NOT NULL,
  PRIMARY KEY (`numat`),
  KEY `numens` (`numens`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Contenu de la table `matiere`
--

INSERT INTO `Umatiere` (`numat`, `nomat`, `coeff`, `numens`) VALUES
('ANG', 'ANGLAIS', 3, 8),
('ECO', 'ECONOMIE', 3, 6),
('HIS', 'HISTOIRE', 2, 15),
('INF', 'INFORMATIQUE', 5, 10),
('LET', 'FRANCAIS', 2, 4),
('MAT', 'MATHEMATIQUES', 2, 1),
('SOC', 'SOCIOLOGIE', 4, 12);

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

--
-- Structure de la table `notes`
--

CREATE TABLE IF NOT EXISTS `Unotes` (
  `numetu` int(4) NOT NULL,
  `numat` varchar(3) NOT NULL,
  `note` int(11) NOT NULL,
  PRIMARY KEY (`numetu`,`numat`),
  KEY `numat` (`numat`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Contenu de la table `notes`
--

INSERT INTO `Unotes` (`numetu`, `numat`, `note`) VALUES
(1, 'ANG', 13),
(1, 'ECO', 8),
(1, 'HIS', 12),
(1, 'INF', 19),
(1, 'LET', 18),
(1, 'MAT', 15),
(1, 'SOC', 8),
(2, 'LET', 7),
(2, 'MAT', 5),
(2, 'SOC', 13),
(3, 'ANG', 6),
(3, 'ECO', 11),
(3, 'HIS', 7),
(3, 'INF', 16),
(3, 'LET', 11),
(3, 'MAT', 12),
(3, 'SOC', 10),
(4, 'LET', 15),
(4, 'MAT', 8),
(4, 'SOC', 10),
(5, 'ANG', 5),
(5, 'ECO', 19),
(5, 'MAT', 3),
(6, 'ECO', 8),
(6, 'HIS', 9),
(6, 'MAT', 15),
(7, 'ECO', 11),
(7, 'INF', 14),
(7, 'MAT', 12),
(8, 'ANG', 7),
(8, 'ECO', 5),
(8, 'MAT', 9),
(9, 'ANG', 6),
(9, 'ECO', 15),
(9, 'MAT', 10),
(10, 'LET', 12),
(10, 'MAT', 11),
(10, 'SOC', 13),
(11, 'ECO', 10),
(11, 'HIS', 17),
(11, 'MAT', 6),
(12, 'LET', 10),
(12, 'MAT', 16),
(12, 'SOC', 5),
(13, 'ECO', 10),
(13, 'INF', 15),
(13, 'MAT', 8),
(14, 'ANG', 11),
(14, 'ECO', 10),
(14, 'MAT', 6),
(15, 'ANG', 13),
(15, 'ECO', 12),
(15, 'MAT', 14),
(16, 'ECO', 12),
(16, 'HIS', 17),
(16, 'MAT', 16),
(17, 'ECO', 9),
(17, 'INF', 5),
(17, 'MAT', 8),
(18, 'LET', 18),
(18, 'MAT', 19),
(18, 'SOC', 11),
(19, 'ECO', 8),
(19, 'HIS', 12),
(19, 'MAT', 15);

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

--
-- Contraintes pour la table `matiere`
--
ALTER TABLE `Umatiere`
  ADD CONSTRAINT `matiere_ibfk_1` FOREIGN KEY (`numens`) REFERENCES `Uenseignant` (`numens`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Contraintes pour la table `notes`
--
ALTER TABLE `Unotes`
  ADD CONSTRAINT `notes_ibfk_1` FOREIGN KEY (`numetu`) REFERENCES `Uetudiant` (`numetu`),
  ADD CONSTRAINT `notes_ibfk_2` FOREIGN KEY (`numat`) REFERENCES `Umatiere` (`numat`);
