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