Professional Documents
Culture Documents
RAPPORT
SCIENCE
D'INFORMATION :
TP1:
Les requêtes SQL :
1.
2.
select ResNo fr
om reservations
where DateNow
between'2006-
11-
01' and '2006-
11-30'
3..
selectResNo
4. select ResNo,DateOut-dateln as
duree from reservation group by
ResNo;
6. select ResNo from reservations join paymenttypes using (Payment) where Description="Visa"
FILIERE :Génie Aéronautique et Technologie de l’Espace
7. select ResNo ,avg(Price) as moyenne from rooms join reservations using (Room) where DateNow='2006-
11-01';
8. SELECT COUNT(Hotel),Name FROM Hotels NATURAL JOIN Reservations WHERE DateIn BETWEEN
'2006-11-01'AND'2006-11-30' GROUP BY Hotel;
10.select count(ResNo),Name from reservations join hotels using (Hotel) group by stars;
11. select count(ResNo) as total_reservation, hotel from reservations join hotels using (Hotel) group by
Hotel order by total_reservation DESC limit 1;
12. SELECT * FROM hotels join rooms using (Hotel) group by Hotel order by Price DESC LIMIT 1;
FILIERE :Génie Aéronautique et Technologie de l’Espace
13.
SELECT DISTINCT(Hotel),Name FROM hotels join Rooms using (Hotel) where Price in (
SELECT Price from rooms join hotels using (Hotel) where Name="Grand View Hotel")
and Name<>"Grand View Hotel";
14.
SELECT DISTINCT Name FROM hotels JOIN rooms WHERE Price > ALL (SELECT Price FROM hotels
NATURAL JOIN rooms WHERE Name ='Grand View Hotel')
FILIERE :Génie Aéronautique et Technologie de l’Espace
TP 2 :
1. SELECT Id from employes INNER JOIN participer on employes.Id =participer.Emp INNER JOIN projet
on participer.Proj=projet.Id_p WHERE Titre="SI Vente" or Titre="Blog RH"