Créer un compte
Connexion

recuperation de donnees multiples dans mysql

Pour créer et répondre aux sujets, vous devez être connecté.
Pages: 1
Auteur Message
topvision
26/09/2014 à 14:31:11
topvision
Membre
Bonjour
je veux faire des bulletins de note pour les eleves
je dois recuperer les coeficients pour les matieres et c'est fait pour les eleves qui ne font lv1 et lv2. comment les combiner pour pouvoir affichier leur coeficients
puisqu'il sont dans repartis dans 3 tables coeficient, lv1,lv2.
si on entre les matricule 5,6,7 ca marche pour les eleves qui ne font pas lv1 et lv2 mais pour les matricules 17, 18,19, qui font les lv il affiche 1 comme coefficient pour tous
<?php


include('includes/reference.php');
$host = 'localhost';
$user = 'root';
$pass = '';
$bdd = 'notes';
@mysql_connect($host,$user,$pass)
or die("Impossible de se connecter");
@mysql_select_db("$bdd")
or die("Impossible de se connecter");


$id=$_GET['id'];

$req=mysql_query("SELECT * FROM eleve,note,matiere,coeficient WHERE
idelevenote='$id' AND idelevenote=ideleve AND matierenote=matierec and serieEl=seriec and matierenote=matiere ")
or die ('Error '.mysql_error());
$req2=mysql_query("SELECT * FROM eleve,note,lv1 WHERE
idelevenote='$id' AND idelevenote=ideleve AND classeEl=classelv1 AND serieEl=serielv1 AND matierenote=matierelv1 ")
or die ('Error '.mysql_error());

$sql3=mysql_query("SELECT * FROM eleve, classe, serie WHERE ideleve='$id' and classeEL=classe and serieEl=serie");
$entete=mysql_fetch_array($sql3);

?>



<!DOCTYPE htm>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>Bulletin</title>
<meta name="keywords" content="" />
<meta name="description" content="" />
<link href="../css/bulletin.css" rel="stylesheet" type="text/css" />
</head>
<body>
<table>
<tr>
<td>
<form name="formrem" method="GET" action="notlvd.php">
<label><br />Entrer Matricule
<input type="text" name="id" value="<?php if(isset($_GET['id']))echo $_GET['id']; ?>" />
</label>
<label>
<input type="submit" name="bouton1" value="rechercher">
</label>
</form>

</table>
<div id="page">
<table align="center" width=870px border= 1px solid black >
<tr>

<td colspan=3>
Ministere de l'education <br/>
<?php
echo $scool_name.'<br/>';
echo $scool_adresse.' - '.$scool_ville.'<br/>' ;
echo "Autorisation : ".$scool_ninea.'<br/>' ;
echo "Tel : ".$scool_tel.'<br/>' ;
echo "Courriel : ".$scool_mail.'<br/>' ;
?>

</td>
<td >
<br/>
<?php
echo 'Année scolaire: '.$scool_name.'<br/>';
echo datedetailfr() ;


?>

</td>

</tr>
<tr>
<td>Nom:&nbsp;&nbsp;<?php echo $entete['nomEl']; ?> </td>

<td >Prenom: <?php echo $entete['prenomEl']; ?> </td>
<td>Classe: <?php echo $entete['classe']; ?> </td>

<td>Serie: <?php echo $entete['serieEl']; ?> </td>
</tr>
</table>
<br /><br /><br />
<div class="pos">

<table align="center" border="1px solid black" width=800px>
<caption>Bulletin de note</caption>


<th>Mat.</th><th>Matiere</th><th>note1</th><th>note2</th><th>note3</th>
<th>compo1</th><th>Semetre1</th><th>idmatiere</th><th>serie</th><th>coef</th><th>notecoef</th><th>Observation</th>


<?php
$somcoef=0;
$somnotecoef=0;

if ($entete['lv1El']=='' and $entete['lv2El']==''){
while ($eleve=mysql_fetch_array($req)){

if(empty($eleve['compo1']))
{
$trim1=($eleve['note1'] + $eleve['note2'] + $eleve['note3']) / 3;
}
if(empty($eleve['note1']))
{
$trim1=($eleve['note2'] + $eleve['note3'] + $eleve['compo1']) / 3;
}
if(empty($eleve['note2']))
{
$trim1=($eleve['note1'] + $eleve['note3'] + $eleve['compo1']) / 3;
}
if(empty($eleve['note3']))
{
$trim1=($eleve['note1'] + $eleve['note2'] + $eleve['compo1']) / 3;
}
if(empty($eleve['note1']) AND empty($eleve['compo1']))
{
$trim1=($eleve['note2'] + $eleve['note3']) / 2;
}
if(empty($eleve['note1']) AND empty($eleve['note3']))
{
$trim1=($eleve['note2'] + $eleve['compo1']) / 2;
}
if(empty($eleve['note1']) AND empty($eleve['note2']))
{
$trim1=($eleve['note3'] + $eleve['compo1']) / 2;
}
if(empty($eleve['note1']) AND empty($eleve['note2']) AND empty($eleve['note3']))
{
$trim1=$eleve['compo1'] ;
}
if(empty($eleve['note2']) AND empty($eleve['note3']) AND empty($eleve['compo1']))
{
$trim1=$eleve['note1'];
}
if(empty($eleve['note1']) AND empty($eleve['note3']) AND empty($eleve['compo1']))
{
$trim1=$eleve['note2'];
}
if(empty($eleve['note1']) AND empty($eleve['note2']) AND empty($eleve['compo1']))
{
$trim1=$eleve['note3'];
}
else
{
$trim1=($eleve['note1'] + $eleve['note2'] + $eleve['note3'] + $eleve['compo1']) / 4;
}



$notecoef=$trim1*$eleve['coef'];
$somcoef+=$eleve['coef'];
$somnotecoef+=$trim1*$eleve['coef'];
$moy=$somnotecoef/$somcoef;
$sql4=mysql_query("SELECT SUM(note1) FROM note");
$nbr=mysql_num_rows($req);

if($trim1<=7){
$obs='Passable';}
elseif($trim1<=10){
$obs='Abien';}
elseif($trim1<=15){
$obs='Bien';}
elseif($trim1<=20){
$obs='Tres bien';
}


?>


<tr colspan="7">

<td><?php echo $eleve['idelevenote']; ?></td>
<td><?php echo $eleve['matiere']; ?></td>
<td><?php echo $eleve['note1']; ?></td>
<td><?php echo $eleve['note2']; ?></td>
<td><?php echo $eleve['note3']; ?></td>
<td><?php echo $eleve['compo1']; ?></td>
<td><?php echo $trim1 ; ?></td>

<td><?php echo $eleve['matierec']; ?></td>
<td><?php echo $eleve['serieEl']; ?></td>
<td><?php echo $eleve['coef']; ?></td>
<td><?php echo $notecoef; ?></td>
<td><?php echo $obs; ?></td>
<?php } ?>

</tr>
<tr>
<td colspan="2">Total points</td>
<td><?php echo $somnotecoef; ?></td>
<td colspan="2">Moyenne</td>
<td><?php echo Round($moy,2); // permet de limiter a 2 chiffre apres la virgule ?></td>
</tr>

<?php echo $somnotecoef; ?>
<?php echo $somcoef; ?>
<?php


}
else

{

while ($eleve=mysql_fetch_array($req) OR $eleve=mysql_fetch_array($req)){

if(empty($eleve['compo1']))
{
$trim1=($eleve['note1'] + $eleve['note2'] + $eleve['note3']) / 3;
}
if(empty($eleve['note1']))
{
$trim1=($eleve['note2'] + $eleve['note3'] + $eleve['compo1']) / 3;
}
if(empty($eleve['note2']))
{
$trim1=($eleve['note1'] + $eleve['note3'] + $eleve['compo1']) / 3;
}
if(empty($eleve['note3']))
{
$trim1=($eleve['note1'] + $eleve['note2'] + $eleve['compo1']) / 3;
}
if(empty($eleve['note1']) AND empty($eleve['compo1']))
{
$trim1=($eleve['note2'] + $eleve['note3']) / 2;
}
if(empty($eleve['note1']) AND empty($eleve['note3']))
{
$trim1=($eleve['note2'] + $eleve['compo1']) / 2;
}
if(empty($eleve['note1']) AND empty($eleve['note2']))
{
$trim1=($eleve['note3'] + $eleve['compo1']) / 2;
}
if(empty($eleve['note1']) AND empty($eleve['note2']) AND empty($eleve['note3']))
{
$trim1=$eleve['compo1'] ;
}
if(empty($eleve['note2']) AND empty($eleve['note3']) AND empty($eleve['compo1']))
{
$trim1=$eleve['note1'];
}
if(empty($eleve['note1']) AND empty($eleve['note3']) AND empty($eleve['compo1']))
{
$trim1=$eleve['note2'];
}
if(empty($eleve['note1']) AND empty($eleve['note2']) AND empty($eleve['compo1']))
{
$trim1=$eleve['note3'];
}
else
{
$trim1=($eleve['note1'] + $eleve['note2'] + $eleve['note3'] + $eleve['compo1']) / 4;
}



$notecoef=$trim1*$eleve['coef'];
$somcoef+=$eleve['coef'];
$somnotecoef+=$trim1*$eleve['coef'];
$moy=$somnotecoef/$somcoef;

$sql4=mysql_query("SELECT SUM(note1) FROM note");
$nbr=mysql_num_rows($req);

if($trim1<=7){
$obs='Passable';}
elseif($trim1<=10){
$obs='Abien';}
elseif($trim1<=15){
$obs='Bien';}
elseif($trim1<=20){
$obs='Tres bien';
}


?>


<tr colspan="7">

<td><?php echo $eleve['idelevenote']; ?></td>
<td><?php echo $eleve['matiere']; ?></td>
<td><?php echo $eleve['note1']; ?></td>
<td><?php echo $eleve['note2']; ?></td>
<td><?php echo $eleve['note3']; ?></td>
<td><?php echo $eleve['compo1']; ?></td>
<td><?php echo $trim1 ; ?></td>

<td><?php echo $eleve['matierec']; ?></td>
<td><?php echo $eleve['serieEl']; ?></td>
<td><?php echo $eleve['coef'] OR $eleve['coeflv1'] ; ?></td>
<td><?php echo $notecoef; ?></td>
<td><?php echo $obs; ?></td>
<?php } ?>

</tr>
<tr>
<td colspan="2">Total points</td>
<td><?php echo $somnotecoef; ?></td>
<td colspan="2">Moyenne</td>
<td><?php echo Round($moy,2); // permet de limiter a 2 chiffre apres la virgule ?></td>
</tr>

<?php echo $somnotecoef; ?>
<?php echo $somcoef; ?>
<?php
}
?>>
</table>
</div>
</div>
</body>
</html>
voici la base

-- phpMyAdmin SQL Dump
-- version 3.5.2.2
-- http://www.phpmyadmin.net
--
-- Client: 127.0.0.1
-- Généré le: Ven 26 Septembre 2014 à 01:37
-- Version du serveur: 5.5.27-log
-- Version de PHP: 5.4.6

SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";


/*!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: `notes`
--
CREATE DATABASE `notes` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
USE `notes`;

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

--
-- Structure de la table `admin`
--

CREATE TABLE `admin` (
`pread` varchar(2) NOT NULL DEFAULT 'AD',
`idad` int(11) NOT NULL AUTO_INCREMENT,
`nomad` varchar(25) NOT NULL,
`prenomad` varchar(60) NOT NULL,
`telad` varchar(12) NOT NULL,
`tel2ad` varchar(12) NOT NULL,
`mailad` varchar(60) NOT NULL,
`passead` varchar(255) NOT NULL,
`photoad` varchar(25) NOT NULL DEFAULT 'avatarad.jpg',
PRIMARY KEY (`idad`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=3 ;

--
-- Contenu de la table `admin`
--

INSERT INTO `admin` (`pread`, `idad`, `nomad`, `prenomad`, `telad`, `tel2ad`, `mailad`, `passead`, `photoad`) VALUES
('AD', 1, 'TALL', 'Mouhamed', '778555456', '', 'tallamoust@gmail.com', '89e495e7941cf9e40e6980d14a16bf023ccd4c91', 'avatarad.jpg'),
('AD', 2, 'FALL', 'Ahmed', '657678789', '', '', 'db61277694fea41b42a8ac82cbb678baac683990', 'avatarad.jpg');

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

--
-- Structure de la table `classe`
--

CREATE TABLE `classe` (
`classe` varchar(20) NOT NULL,
PRIMARY KEY (`classe`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Contenu de la table `classe`
--

INSERT INTO `classe` (`classe`) VALUES
(''),
('1iere'),
('2nde'),
('3ieme'),
('4ieme'),
('5iem'),
('6iem'),
('Tle');

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

--
-- Structure de la table `coeficient`
--

CREATE TABLE `coeficient` (
`idcoef` int(11) NOT NULL AUTO_INCREMENT,
`matierec` varchar(25) NOT NULL,
`seriec` varchar(5) NOT NULL,
`coef` int(11) NOT NULL,
PRIMARY KEY (`idcoef`),
KEY `matierec` (`matierec`,`seriec`),
KEY `seriec` (`seriec`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=17 ;

--
-- Contenu de la table `coeficient`
--

INSERT INTO `coeficient` (`idcoef`, `matierec`, `seriec`, `coef`) VALUES
(1, 'Anglais', 'L1', 3),
(2, 'Anglais', 'L2', 4),
(3, 'Anglais', 'S1', 1),
(4, 'Anglais', 'S2', 2),
(5, 'Français', 'L1', 5),
(6, 'Français', 'L2', 3),
(7, 'Français', 'S1', 2),
(8, 'Français', 'S2', 1),
(9, 'Mathematique', 'L1', 2),
(10, 'Mathematique', 'L2', 3),
(11, 'Mathematique', 'S1', 5),
(12, 'Mathematique', 'S2', 3),
(13, 'Philo', 'L1', 4),
(14, 'Philo', 'L2', 5),
(15, 'Philo', 'S1', 1),
(16, 'Philo', 'S2', 1);

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

--
-- Structure de la table `eleve`
--

CREATE TABLE `eleve` (
`pre` varchar(2) NOT NULL DEFAULT 'EL',
`ideleve` int(11) NOT NULL AUTO_INCREMENT,
`nomEl` varchar(25) NOT NULL,
`prenomEl` varchar(50) NOT NULL,
`ClasseEl` varchar(20) NOT NULL,
`serieEl` varchar(5) NOT NULL,
`lv1El` varchar(25) NOT NULL,
`lv2El` varchar(25) NOT NULL,
`cr` varchar(20) NOT NULL,
`session` varchar(9) NOT NULL,
PRIMARY KEY (`ideleve`),
KEY `ClasseEl` (`ClasseEl`,`serieEl`,`lv1El`,`lv2El`,`cr`,`session`),
KEY `session` (`session`),
KEY `cr` (`cr`),
KEY `lv2El` (`lv2El`),
KEY `lv1El` (`lv1El`),
KEY `serieEl` (`serieEl`),
KEY `ClasseEl_2` (`ClasseEl`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=21 ;

--
-- Contenu de la table `eleve`
--

INSERT INTO `eleve` (`pre`, `ideleve`, `nomEl`, `prenomEl`, `ClasseEl`, `serieEl`, `lv1El`, `lv2El`, `cr`, `session`) VALUES
('EL', 4, 'SALL', 'Mouhamed Amdy', '3ieme', 'L1', '', '', '', '2013/2014'),
('EL', 5, 'TALL', 'Fatoubintou', '3ieme', 'L1', '', '', '', '2013/2014'),
('EL', 6, 'DIAME', 'Alamine', '3ieme', 'L1', '', '', '', '2013/2014'),
('EL', 7, 'NDIAYE', 'Babacar', '3ieme', 'L1', '', '', '4ieme', '2012/2013'),
('EL', 8, 'DIAWARA', 'Maimouna', '4ieme', 'L2', '', '', '', '2013/2014'),
('EL', 9, 'SAGNA', 'Landing', '4ieme', 'L2', '', '', '', '2013/2014'),
('EL', 10, 'TALL', 'Elimane', '4ieme', 'S1', '', '', '6iem', '2013/2014'),
('EL', 11, 'CISSE', 'Daba', '4ieme', 'S1', '', '', '', '2013/2014'),
('EL', 12, 'BADJI', 'Mamadou', '5iem', '', '', '', '', '2013/2014'),
('EL', 13, 'LO', 'Rama', '5iem', '', '', '', '', '2013/2014'),
('EL', 14, 'KANE', 'Khady', '3ieme', 'S1', '', '', '', '2013/2014'),
('EL', 15, 'GAYE', 'Nana', '3ieme', 'S1', '', '', '', '2013/2014'),
('EL', 16, 'DIA', 'Aminta', '3ieme', 'S1', '', '', '', '2013/2014'),
('EL', 17, 'Aris', 'Mussa', 'Tle', 'L1', 'Anglais', '', '', '2013/2014'),
('EL', 18, 'DIATTA', 'Mamadou', 'Tle', 'L2', 'Anglais', '', '', '2013/2014'),
('EL', 19, 'NDIAYE', 'Fatou', 'Tle', 'S1', 'Anglais', '', '', '2013/2014'),
('EL', 20, 'Dieye', 'Maguette', 'Tle', 'S2', '', 'Anglais', '', '2013/2014');

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

--
-- Structure de la table `lv1`
--

CREATE TABLE `lv1` (
`classelv1` varchar(25) NOT NULL,
`serielv1` varchar(5) NOT NULL,
`matierelv1` varchar(25) NOT NULL,
`coeflv1` int(11) NOT NULL,
KEY `classelv1` (`classelv1`,`serielv1`,`matierelv1`,`coeflv1`),
KEY `classelv1_2` (`classelv1`),
KEY `serielv1` (`serielv1`),
KEY `matierelv1` (`matierelv1`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Contenu de la table `lv1`
--

INSERT INTO `lv1` (`classelv1`, `serielv1`, `matierelv1`, `coeflv1`) VALUES
('Tle', 'L1', 'Anglais', 4),
('Tle', 'L1', 'Arabe', 3),
('Tle', 'L1', 'Espagnol', 2),
('Tle', 'L1', 'Russe', 3),
('Tle', 'L2', 'Anglais', 2),
('Tle', 'L2', 'Arabe', 3),
('Tle', 'L2', 'Espagnol', 3),
('Tle', 'L2', 'Russe', 3),
('Tle', 'S1', 'Anglais', 3),
('Tle', 'S1', 'Arabe', 4);

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

--
-- Structure de la table `lv2`
--

CREATE TABLE `lv2` (
`classelv2` varchar(20) NOT NULL,
`serielv2` varchar(5) NOT NULL,
`matierelv2` varchar(25) NOT NULL,
`coeflv2` int(2) NOT NULL,
KEY `classelv2` (`classelv2`),
KEY `serielv2` (`serielv2`),
KEY `matierelv2` (`matierelv2`),
KEY `coeflv2` (`coeflv2`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Contenu de la table `lv2`
--

INSERT INTO `lv2` (`classelv2`, `serielv2`, `matierelv2`, `coeflv2`) VALUES
('Tle', 'L1', 'Anglais', 2),
('Tle', 'L1', 'Arabe', 3),
('Tle', 'L1', 'Espagnol', 2),
('Tle', 'L1', 'Russe', 1),
('Tle', 'L2', 'Anglais', 2),
('Tle', 'L2', 'Arabe', 2),
('Tle', 'L2', 'Espagnol', 2),
('Tle', 'L2', 'Russe', 2),
('Tle', 'S1', 'Anglais', 2),
('Tle', 'S1', 'Arabe', 1);

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

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

CREATE TABLE `matiere` (
`matiere` varchar(25) NOT NULL,
PRIMARY KEY (`matiere`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

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

INSERT INTO `matiere` (`matiere`) VALUES
(''),
('Anglais'),
('Français'),
('Mathematique'),
('Philo');

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

--
-- Structure de la table `matierelv`
--

CREATE TABLE `matierelv` (
`matierelv` varchar(25) NOT NULL,
KEY `matierelv` (`matierelv`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Contenu de la table `matierelv`
--

INSERT INTO `matierelv` (`matierelv`) VALUES
('Anglais'),
('Arabe'),
('Espagnol'),
('Russe');

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

--
-- Structure de la table `note`
--

CREATE TABLE `note` (
`idnote` int(11) NOT NULL AUTO_INCREMENT,
`idelevenote` int(11) NOT NULL,
`matierenote` varchar(25) NOT NULL,
`note1` float DEFAULT NULL,
`note2` float DEFAULT NULL,
`note3` float DEFAULT NULL,
`compo1` float DEFAULT NULL,
PRIMARY KEY (`idnote`),
KEY `idelevenote` (`idelevenote`,`matierenote`),
KEY `idelevenote_2` (`idelevenote`),
KEY `matierenote` (`matierenote`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=81 ;

--
-- Contenu de la table `note`
--

INSERT INTO `note` (`idnote`, `idelevenote`, `matierenote`, `note1`, `note2`, `note3`, `compo1`) VALUES
(1, 5, 'Anglais', 11, 13, 10, 12),
(2, 5, 'Français', 9, 11, 9, 9),
(3, 5, 'Mathematique', 12, 0, 12, 0),
(4, 5, 'Philo', 0, 15, 0, 18),
(5, 6, 'Anglais', 11, 12, 13, 12),
(6, 6, 'Français', 0, 0, 12, 12),
(7, 6, 'Mathematique', 12, 2, 12, 12),
(8, 6, 'Philo', 15, 14, 15, 14),
(9, 7, 'Anglais', 11, 0, 13, 14),
(10, 7, 'Français', 12, 14, 0, 14),
(11, 7, 'Mathematique', 0, 14, 12, 13),
(12, 7, 'Philo', 14, 0, 14, 12),
(13, 4, 'Anglais', 16, 15, 12, 11),
(14, 4, 'Français', 14, 0, 13, 0),
(15, 4, 'Mathematique', 7, 6, 0, 0),
(16, 4, 'Philo', 12, 10, NULL, 10),
(17, 8, 'Anglais', 15, NULL, 12, 12),
(18, 8, 'Français', 15, 15, NULL, 12),
(19, 8, 'Mathematique', 9, NULL, 10, 8),
(20, 8, 'Philo', 12, 12, NULL, 13),
(21, 9, 'Anglais', 12, NULL, 13, 12),
(22, 9, 'Français', NULL, 12, 12, 10),
(23, 9, 'Mathematique', 9, 9, NULL, 10),
(24, 9, 'Philo', 11, 14, 13, 14),
(25, 10, 'Anglais', 13, 13, NULL, 12),
(26, 10, 'Français', NULL, 15, 14, 13),
(27, 10, 'Mathematique', 11, 9, NULL, 9),
(28, 10, 'Philo', 15, 13, NULL, 14),
(34, 11, 'Anglais', 11, 12, 11, 12),
(64, 11, 'Mathematique', 11, 12, 12, 11),
(67, 11, 'Français', 11, 12, 12, 10),
(71, 17, 'Français', 11, 12, 11, 12),
(73, 18, 'Anglais', 12, 12, 11, 12),
(74, 18, 'Mathematique', 10, 10, 11, 12),
(75, 17, 'Anglais', 11, 10, NULL, 11),
(76, 17, 'Mathematique', 15, 13, NULL, 12),
(78, 18, 'Français', 11, 12, NULL, 11),
(79, 19, 'Anglais', 11, NULL, NULL, 11),
(80, 20, 'Anglais', 15, 15, NULL, 13);

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

--
-- Structure de la table `serie`
--

CREATE TABLE `serie` (
`serie` varchar(5) NOT NULL,
PRIMARY KEY (`serie`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Contenu de la table `serie`
--

INSERT INTO `serie` (`serie`) VALUES
(''),
('L1'),
('L2'),
('S1'),
('S2');

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

--
-- Structure de la table `session`
--

CREATE TABLE `session` (
`session` varchar(9) NOT NULL,
PRIMARY KEY (`session`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Contenu de la table `session`
--

INSERT INTO `session` (`session`) VALUES
('2012/2013'),
('2013/2014');

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

--
-- Contraintes pour la table `coeficient`
--
ALTER TABLE `coeficient`
ADD CONSTRAINT `coeficient_ibfk_1` FOREIGN KEY (`matierec`) REFERENCES `matiere` (`matiere`),
ADD CONSTRAINT `coeficient_ibfk_2` FOREIGN KEY (`seriec`) REFERENCES `serie` (`serie`);

--
-- Contraintes pour la table `eleve`
--
ALTER TABLE `eleve`
ADD CONSTRAINT `eleve_ibfk_1` FOREIGN KEY (`ClasseEl`) REFERENCES `classe` (`classe`),
ADD CONSTRAINT `eleve_ibfk_2` FOREIGN KEY (`serieEl`) REFERENCES `serie` (`serie`),
ADD CONSTRAINT `eleve_ibfk_3` FOREIGN KEY (`lv1El`) REFERENCES `matiere` (`matiere`),
ADD CONSTRAINT `eleve_ibfk_4` FOREIGN KEY (`lv2El`) REFERENCES `matiere` (`matiere`),
ADD CONSTRAINT `eleve_ibfk_5` FOREIGN KEY (`cr`) REFERENCES `classe` (`classe`),
ADD CONSTRAINT `eleve_ibfk_6` FOREIGN KEY (`session`) REFERENCES `session` (`session`);

--
-- Contraintes pour la table `lv1`
--
ALTER TABLE `lv1`
ADD CONSTRAINT `lv1_ibfk_1` FOREIGN KEY (`classelv1`) REFERENCES `classe` (`classe`),
ADD CONSTRAINT `lv1_ibfk_2` FOREIGN KEY (`serielv1`) REFERENCES `serie` (`serie`),
ADD CONSTRAINT `lv1_ibfk_3` FOREIGN KEY (`matierelv1`) REFERENCES `matierelv` (`matierelv`);

--
-- Contraintes pour la table `lv2`
--
ALTER TABLE `lv2`
ADD CONSTRAINT `lv2_ibfk_1` FOREIGN KEY (`classelv2`) REFERENCES `classe` (`classe`),
ADD CONSTRAINT `lv2_ibfk_2` FOREIGN KEY (`serielv2`) REFERENCES `serie` (`serie`),
ADD CONSTRAINT `lv2_ibfk_3` FOREIGN KEY (`matierelv2`) REFERENCES `matierelv` (`matierelv`);

--
-- Contraintes pour la table `note`
--
ALTER TABLE `note`
ADD CONSTRAINT `note_ibfk_1` FOREIGN KEY (`idelevenote`) REFERENCES `eleve` (`ideleve`),
ADD CONSTRAINT `note_ibfk_2` FOREIGN KEY (`matierenote`) REFERENCES `matiere` (`matiere`);

/*!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 */;


Pages: 1