diff --git a/corrections/chapitre_05/conf.sql b/corrections/chapitre_05/conf.sql index 66c3353315ed3de4a22028eabdcf355ec257d290..66b5d35ea8edc5589ae647bffbfbbe04fc5ae6a8 100644 --- a/corrections/chapitre_05/conf.sql +++ b/corrections/chapitre_05/conf.sql @@ -88,3 +88,35 @@ SELECT * FROM Visitor LEFT JOIN Registration ON Visitor.login = Registration.login WHERE id_conference IS NULL; + +-- 11 +SELECT V.login, firstname, lastname, COUNT(id_conference) +FROM Visitor AS V +LEFT JOIN Registration AS R ON V.login = R.login +GROUP BY V.login; + + +-- 12 +SELECT lastname, firstname, start_date, end_date, name +FROM Speaker AS S +INNER JOIN Stay AS ST ON S.login = ST.login +INNER JOIN Hotel AS H ON ST.id_hotel = H.id_hotel; + +-- 13 +SELECT T.title, COUNT(DISTINCT login) +FROM Topic AS T +LEFT JOIN Conference AS C ON T.title = C.title +LEFT JOIN Registration AS R ON C.id_conference = R.id_conference +GROUP BY T.title; + +-- 14 +SELECT C.name, start_date, end_date, +( + SELECT COUNT(R.login) FROM Registration AS R + WHERE C.id_conference = R.id_conference +) AS Visitors, +( + SELECT COUNT(P.login) FROM Participation AS P + WHERE C.id_conference = P.id_conference +) AS Speakers +FROM Conference AS C;