/*********
*
*	Insertions
*
*********/

ROLLBACK;
--			Insertions Voyageurs

INSERT INTO Voyageur (NVoyageur, Nom, Prenom, sexe, adresse) VALUES ((SELECT NVL(MAX(NVoyageur)+1,1) FROM Voyageur), 'Moulay', 'Karim','m', 'Dijon');
INSERT INTO Voyageur (NVoyageur, Nom, Prenom, sexe, adresse) VALUES ((SELECT NVL(MAX(NVoyageur)+1,1) FROM Voyageur), 'Moulay', 'Joker','m', 'NewYork');
INSERT INTO Voyageur (NVoyageur, Nom, Prenom, sexe, adresse) VALUES ((SELECT NVL(MAX(NVoyageur)+1,1) FROM Voyageur), 'Savonnet', 'Marinnette','f', 'Dijon');

--			Insertions Vehicules

INSERT INTO Vehicule (NVehicule, Conducteur, Immatricule, place, Type) VALUES ((SELECT NVL(MAX(NVehicule)+1,1) FROM Vehicule), 1, 'dijon21',5,'Berline');
INSERT INTO Vehicule (NVehicule, Conducteur, Immatricule, place, Type) VALUES ((SELECT NVL(MAX(NVehicule)+1,1) FROM Vehicule), 2, 'New York',8,'4*4');
INSERT INTO Vehicule (NVehicule, Conducteur, Immatricule, place, Type) VALUES ((SELECT NVL(MAX(NVehicule)+1,1) FROM Vehicule), 1, 'dijon21',4,'Citadine');

--			Insertions Ville

INSERT INTO Ville SELECT NVL(MAX(NVille)+1,1) , 'Dijon', 21000 FROM Ville;
INSERT INTO Ville SELECT NVL(MAX(NVille)+1,1) , 'Paris', 75012 FROM Ville;
INSERT INTO Ville SELECT NVL(MAX(NVille)+1,1) , 'New York', 10001 FROM Ville;
INSERT INTO Ville SELECT NVL(MAX(NVille)+1,1) , 'Philadelphie', 19147 FROM Ville;

--			Insertions Voyages

INSERT INTO Voyage (1, 1, 2, 1, '23-Dec-08');
INSERT INTO Voyage (2, 2, 1, 4, '29-Dec-08');
INSERT INTO Voyage (3, 2, 3, 1, '09-Jan-09');

--			Insertions Covoiturage

INSERT INTO Covoiturage VALUES ((SELECT NVL(MAX(Idev)+1,1) FROM Covoiturage), 1, 1, 4);
INSERT INTO Covoiturage VALUES ((SELECT NVL(MAX(Idev)+1,1) FROM Covoiturage), 2, 2, 7);
INSERT INTO Covoiturage VALUES ((SELECT NVL(MAX(Idev)+1,1) FROM Covoiturage), 1, 2, 3);
INSERT INTO Covoiturage VALUES ((SELECT NVL(MAX(Idev)+1,1) FROM Covoiturage), 2, 3, 6);
INSERT INTO Covoiturage VALUES ((SELECT NVL(MAX(Idev)+1,1) FROM Covoiturage), 2, 1, 5);
INSERT INTO Covoiturage VALUES ((SELECT NVL(MAX(Idev)+1,1) FROM Covoiturage), 3, 1, 7);
INSERT INTO Covoiturage VALUES ((SELECT NVL(MAX(Idev)+1,1) FROM Covoiturage), 1, 3, 2);
INSERT INTO Covoiturage VALUES ((SELECT NVL(MAX(Idev)+1,1) FROM Covoiturage), 3, 1, 6);

--			Insertions Evaluations

INSERT INTO Evaluation VALUES ((SELECT NVL(MAX(Idev)+1,1) FROM Evaluation), 1, 1, 2, 4, "...");
INSERT INTO Evaluation VALUES ((SELECT NVL(MAX(Idev)+1,1) FROM Evaluation), 1, 3, 1, 3, "");
INSERT INTO Evaluation VALUES ((SELECT NVL(MAX(Idev)+1,1) FROM Evaluation), 3, 1, 3, 5, "++");
INSERT INTO Evaluation VALUES ((SELECT NVL(MAX(Idev)+1,1) FROM Evaluation), 1, 2, 3, 4, "^^");
INSERT INTO Evaluation VALUES ((SELECT NVL(MAX(Idev)+1,1) FROM Evaluation), 2, 1, 2, 2, ":(");
INSERT INTO Evaluation VALUES ((SELECT NVL(MAX(Idev)+1,1) FROM Evaluation), 2, 2, 1, 4, "cool");
INSERT INTO Evaluation VALUES ((SELECT NVL(MAX(Idev)+1,1) FROM Evaluation), 3, 3, 1, 5, "OKay");

SELECT * FROM Voyageur;
SELECT * FROM Vehicule;
SELECT * FROM Ville;
