INSERT INTO Departement VALUES (nextval('departement_departement_id_seq'),'MIDO');
INSERT INTO Departement VALUES (nextval('departement_departement_id_seq'),'LSO');
INSERT INTO Departement VALUES (nextval('departement_departement_id_seq'),'MSO');

INSERT INTO Enseignant VALUES(nextval('enseignant_enseignant_id_seq'),(SELECT Departement_ID FROM Departement WHERE Nom_Departement='MIDO'),'MANOUVRIER','Maude','MCF','4185','4091','manouvrier@lamsade.dauphine.fr');
INSERT INTO Enseignant VALUES(nextval('enseignant_enseignant_id_seq'),(SELECT Departement_ID FROM Departement WHERE Nom_Departement='MIDO'),'OZTURK','Meltem','MCF','','4091','ozturk@lamsade.dauphine.fr');
INSERT INTO Enseignant VALUES(nextval('enseignant_enseignant_id_seq'),(SELECT Departement_ID FROM Departement WHERE Nom_Departement='MIDO'),'MURAT','Cécile','MCF','','4091','murat@lamsade.dauphine.fr');
INSERT INTO Enseignant VALUES(nextval('enseignant_enseignant_id_seq'),(SELECT Departement_ID FROM Departement WHERE Nom_Departement='MIDO'),'DEBECE','Gilles','Moniteur',NULL,NULL,NULL);

INSERT INTO Master VALUES (nextval('master_master_id_seq'),'ID',(SELECT Enseignant_ID FROM Enseignant WHERE nom='OZTURK'),(SELECT Departement_ID FROM Departement WHERE Nom_Departement='MIDO'));
INSERT INTO Master VALUES (nextval('master_master_id_seq'),'MIAGE-IF', (SELECT Enseignant_ID FROM Enseignant WHERE nom='MANOUVRIER'),(SELECT Departement_ID FROM Departement WHERE Nom_Departement='MIDO'));
INSERT INTO Master VALUES (nextval('master_master_id_seq'),'MIAGE-SITN', (SELECT Enseignant_ID FROM Enseignant WHERE nom='MURAT'),(SELECT Departement_ID FROM Departement WHERE Nom_Departement='MIDO'));

INSERT INTO Etudiant VALUES (nextval('etudiant_etudiant_id_seq'),'DEBECE', 'Aude','1979/08/15','45, Avenue des abeilles','PARIS','75012',NULL,NULL,NULL,(SELECT Master_ID FROM Master WHERE Nom_Master='MIAGE-IF'));
INSERT INTO Etudiant VALUES (nextval('etudiant_etudiant_id_seq'),'SUFFIT', 'Sam','1985/09/01','145, Boulevard Raspail','PARIS','75014',NULL,NULL,NULL,(SELECT Master_ID FROM Master WHERE Nom_Master='MIAGE-SITN'));

INSERT INTO Enseignement VALUES ('1',(SELECT Master_ID FROM Master WHERE Nom_Master='MIAGE-IF'),'C++/C#/Python','C++ (18h)+ Python (6h) + C#(3h)','NON',(SELECT Enseignant_ID FROM Enseignant WHERE Nom LIKE 'MANOUVRIER'));
INSERT INTO Enseignement VALUES ('2',(SELECT Master_ID FROM Master WHERE Nom_Master='MIAGE-IF'),'Persistance ORM/HIBERNATE','TP JDBC en Java et projet Hibernate + Examen','NON',(SELECT Enseignant_ID FROM Enseignant WHERE Nom LIKE 'MANOUVRIER'));

INSERT INTO Preference VALUES (nextval('preference_preference_id_seq'),(SELECT Etudiant_ID FROM Etudiant WHERE nom ='SUFFIT'), 1, (SELECT Master_ID FROM Master WHERE Nom_Master='MIAGE-IF'), 4);
INSERT INTO Preference VALUES (nextval('preference_preference_id_seq'),(SELECT Etudiant_ID FROM Etudiant WHERE nom ='SUFFIT'), 2, (SELECT Master_ID FROM Master WHERE Nom_Master='MIAGE-IF'), 0);

INSERT INTO Inscription VALUES (nextval('inscription_inscription_id_seq'),(SELECT Etudiant_ID FROM Etudiant WHERE nom ='SUFFIT'), 1, (SELECT Master_ID FROM Master WHERE Nom_Master='MIAGE-IF'));

INSERT INTO Salle VALUES('B','020','15');
INSERT INTO Salle VALUES('B','022','15');

INSERT INTO Reservation VALUES (nextval('reservation_reservation_id_seq'),'B','022',(SELECT Enseignement_ID FROM Enseignement WHERE Intitule LIKE '%C++%'),(SELECT Master_ID FROM Enseignement WHERE Intitule LIKE '%C++%'),(SELECT Enseignant_ID FROM Enseignant WHERE Nom LIKE 'MANOUVRIER'),'2012/01/15','08:30:00','11:45:00','3');
INSERT INTO Reservation VALUES (nextval('reservation_reservation_id_seq'),'B','020',(SELECT Enseignement_ID FROM Enseignement WHERE Intitule LIKE '%HIBERNATE%'),(SELECT Master_ID FROM Enseignement WHERE Intitule LIKE '%HIBERNATE%'),(SELECT Enseignant_ID FROM Enseignant WHERE Nom LIKE 'MANOUVRIER'),'2011/11/17','13:45:00','17:00:00','3');

INSERT INTO Candidature VALUES ((SELECT Etudiant_ID FROM Etudiant WHERE nom ='SUFFIT'), (SELECT Master_ID FROM Master WHERE Nom_Master='MIAGE-IF'),4,true);

INSERT INTO Seminaire VALUES (nextval('seminaire_seminaire_id_seq'),(SELECT Master_ID FROM Master WHERE Nom_Master='MIAGE-IF'),'SG CIB', true);

INSERT INTO Presence VALUES ((SELECT Seminaire_ID FROM Seminaire WHERE seminaire_id=1), (SELECT Etudiant_ID FROM Etudiant WHERE nom ='SUFFIT'));

INSERT INTO Stage VALUES (nextval('stage_stage_id_seq'),(SELECT Etudiant_ID FROM Etudiant WHERE nom ='SUFFIT'),'Stage de développement C++','SG CIB');

INSERT INTO Affectation VALUES (nextval('affectation_affectation_id_seq'),'B','022', (SELECT Master_ID FROM Master WHERE Nom_Master='MIAGE-IF'));

INSERT INTO Biblio VALUES (nextval('biblio_biblio_id_seq'),(SELECT Enseignement_ID FROM Enseignement WHERE Intitule LIKE '%C++%'),(SELECT Master_ID FROM Enseignement WHERE Intitule LIKE '%C++%'),'2 345 678 456');

