diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000..c57d089 Binary files /dev/null and b/.DS_Store differ diff --git a/answers/exercise1.sql b/answers/exercise1.sql index e69de29..5fadf54 100644 --- a/answers/exercise1.sql +++ b/answers/exercise1.sql @@ -0,0 +1,4 @@ +SELECT * +FROM Enrollments +LEFT JOIN Students +ON Enrollments.StudentID = Students.StudentID; \ No newline at end of file diff --git a/answers/exercise2.sql b/answers/exercise2.sql index e69de29..01125c6 100644 --- a/answers/exercise2.sql +++ b/answers/exercise2.sql @@ -0,0 +1,4 @@ +SELECT * +FROM Enrollments +INNER JOIN Students +ON Enrollments.StudentID = Students.StudentID; \ No newline at end of file diff --git a/answers/exercise3.sql b/answers/exercise3.sql index e69de29..72184e1 100644 --- a/answers/exercise3.sql +++ b/answers/exercise3.sql @@ -0,0 +1,4 @@ +SELECT * +FROM Enrollments +RIGHT JOIN Students +ON Enrollments.StudentID = Students.StudentID; \ No newline at end of file diff --git a/answers/exercise4.sql b/answers/exercise4.sql index e69de29..86e8de9 100644 --- a/answers/exercise4.sql +++ b/answers/exercise4.sql @@ -0,0 +1,3 @@ +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..28a7ff4 100644 --- a/answers/exercise5.sql +++ b/answers/exercise5.sql @@ -0,0 +1,4 @@ +SELECT COUNT(*), Country +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..2e0616f 100644 --- a/answers/exercise6.sql +++ b/answers/exercise6.sql @@ -0,0 +1,5 @@ +SELECT COUNT(*), Country +FROM Students +GROUP BY Country +HAVING COUNT(*) > 10 +ORDER BY COUNT(*); \ No newline at end of file