From a083f735999d3465b9435d642c0506a1dce6469d Mon Sep 17 00:00:00 2001 From: MannyMb Date: Fri, 30 Jul 2021 20:18:26 -0400 Subject: [PATCH] fin --- .DS_Store | Bin 0 -> 6148 bytes answers/exercise1.sql | 4 ++++ answers/exercise2.sql | 4 ++++ answers/exercise3.sql | 4 ++++ answers/exercise4.sql | 3 +++ answers/exercise5.sql | 4 ++++ answers/exercise6.sql | 5 +++++ 7 files changed, 24 insertions(+) create mode 100644 .DS_Store diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..c57d08930be5356b033080d39f3c8700ee4a3989 GIT binary patch literal 6148 zcmeHKJ5EC}5S)cbL`st~rLVvZtSC7_E&wES5s`R8w6Ee^94)h-g6KgP3ec>y9(%oG z%Tv643&7TIhkIZNU`}_$hYwTpefNpoRK$pMp7D%V42NNVd^%0CzYjR~4v%=jfcLNb z)6utNQa}nw0VyB_q`;LGr~*4*T=`rbCk3Ry-&erD4~_2F3&+Ixba03kfH-3~jPvLv zh|L4UUN|N)LbIe2lWNssSkf79mDdZ$#H7Qj`LMd#szb53o#(emhxJ5_Qa}n^DsY?2 zrPu#0{fGYllBAUskOKco0h?`hn>C+QwRQ41ueFW-K=+(ax*O*~;SlAR80DA?FUPA$ b%Dm=t?)SnmG3bm3ov5Dy*F`1;ep`VvtSS|( literal 0 HcmV?d00001 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