From 04f1090fae2acf638c3660af4c73b9ca5f34bb40 Mon Sep 17 00:00:00 2001 From: wes Date: Wed, 11 Dec 2019 19:41:14 -0500 Subject: [PATCH] done --- answers/exercise1.sql | 3 +++ answers/exercise2.sql | 3 +++ answers/exercise3.sql | 3 +++ answers/exercise4.sql | 2 ++ answers/exercise5.sql | 3 +++ answers/exercise6.sql | 4 ++++ 6 files changed, 18 insertions(+) diff --git a/answers/exercise1.sql b/answers/exercise1.sql index e69de29..5fd3a55 100644 --- a/answers/exercise1.sql +++ b/answers/exercise1.sql @@ -0,0 +1,3 @@ +SELECT * FROM Enrolments +LEFT JOIN Students +ON Enrolments.StudentID = Students.StudentID; \ No newline at end of file diff --git a/answers/exercise2.sql b/answers/exercise2.sql index e69de29..bdc978e 100644 --- a/answers/exercise2.sql +++ b/answers/exercise2.sql @@ -0,0 +1,3 @@ +SELECT * FROM Enrolments +INNER JOIN Students +ON Enrolments.StudentID = Students.StudentID; \ No newline at end of file diff --git a/answers/exercise3.sql b/answers/exercise3.sql index e69de29..437f8b4 100644 --- a/answers/exercise3.sql +++ b/answers/exercise3.sql @@ -0,0 +1,3 @@ +SELECT * FROM Enrolments +LEFT OUTER JOIN Students +ON Enrolments.StudentID = Students.StudentID; \ No newline at end of file diff --git a/answers/exercise4.sql b/answers/exercise4.sql index e69de29..5182f85 100644 --- a/answers/exercise4.sql +++ b/answers/exercise4.sql @@ -0,0 +1,2 @@ +SELECT country, COUNT(*) FROM Students +GROUP BY country; \ No newline at end of file diff --git a/answers/exercise5.sql b/answers/exercise5.sql index e69de29..5885296 100644 --- a/answers/exercise5.sql +++ b/answers/exercise5.sql @@ -0,0 +1,3 @@ +SELECT country, COUNT(*) FROM Students +GROUP BY country +ORDER BY COUNT(*) DESC; \ No newline at end of file diff --git a/answers/exercise6.sql b/answers/exercise6.sql index e69de29..1cac02f 100644 --- a/answers/exercise6.sql +++ b/answers/exercise6.sql @@ -0,0 +1,4 @@ +SELECT country, COUNT(*) FROM Students +WHERE COUNT(*) > 10 +GROUP BY country +ORDER BY COUNT(*) DESC; \ No newline at end of file