From 9040fb7082ad45ab69aaa872e6d547f05004d26e Mon Sep 17 00:00:00 2001 From: jgiroso Date: Thu, 29 Jul 2021 20:44:16 -0400 Subject: [PATCH] lab complete --- answers/exercise1.sql | 1 + answers/exercise2.sql | 1 + answers/exercise3.sql | 1 + answers/exercise4.sql | 1 + answers/exercise5.sql | 1 + answers/exercise6.sql | 1 + 6 files changed, 6 insertions(+) diff --git a/answers/exercise1.sql b/answers/exercise1.sql index e69de29..15b767a 100644 --- a/answers/exercise1.sql +++ b/answers/exercise1.sql @@ -0,0 +1 @@ +SELECT * FROM Enrolments e LEFT JOIN Students s ON e.StudentID = s.StudentID; \ No newline at end of file diff --git a/answers/exercise2.sql b/answers/exercise2.sql index e69de29..35cf8f6 100644 --- a/answers/exercise2.sql +++ b/answers/exercise2.sql @@ -0,0 +1 @@ +SELECT * FROM Enrolments e INNER JOIN Students s ON e.StudentID = s.StudentID; \ No newline at end of file diff --git a/answers/exercise3.sql b/answers/exercise3.sql index e69de29..d598220 100644 --- a/answers/exercise3.sql +++ b/answers/exercise3.sql @@ -0,0 +1 @@ +SELECT * From Enrolments e RIGHT JOIN Students s ON e.StudentID = s.StudentID; \ No newline at end of file diff --git a/answers/exercise4.sql b/answers/exercise4.sql index e69de29..25e1c15 100644 --- a/answers/exercise4.sql +++ b/answers/exercise4.sql @@ -0,0 +1 @@ +SELECT COUNT(Country) FROM Students GROUP BY Country; \ No newline at end of file diff --git a/answers/exercise5.sql b/answers/exercise5.sql index e69de29..14fea69 100644 --- a/answers/exercise5.sql +++ b/answers/exercise5.sql @@ -0,0 +1 @@ +SELECT COUNT(Country) FROM Students GROUP BY Country ORDER BY COUNT(Country) DESC; \ No newline at end of file diff --git a/answers/exercise6.sql b/answers/exercise6.sql index e69de29..86ca4a3 100644 --- a/answers/exercise6.sql +++ b/answers/exercise6.sql @@ -0,0 +1 @@ +SELECT COUNT(Country) FROM Students GROUP BY Country HAVING COUNT(Country) > 10 ORDER BY COUNT(Country) DESC; \ No newline at end of file