diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..e7e9d11 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,2 @@ +# Default ignored files +/workspace.xml diff --git a/.idea/SQL.LetsGetTogether.iml b/.idea/SQL.LetsGetTogether.iml new file mode 100644 index 0000000..d6ebd48 --- /dev/null +++ b/.idea/SQL.LetsGetTogether.iml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..28a804d --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..a731dc1 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..35eb1dd --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/answers/exercise1.sql b/answers/exercise1.sql index e69de29..af35c9e 100644 --- a/answers/exercise1.sql +++ b/answers/exercise1.sql @@ -0,0 +1,4 @@ +SELECT * +FROM Enrolments AS E +LEFT JOIN Students AS S +ON E.STUDENT_ID=S.STUDENT_ID; \ No newline at end of file diff --git a/answers/exercise2.sql b/answers/exercise2.sql index e69de29..21195a8 100644 --- a/answers/exercise2.sql +++ b/answers/exercise2.sql @@ -0,0 +1,4 @@ +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..0ea8cbd 100644 --- a/answers/exercise3.sql +++ b/answers/exercise3.sql @@ -0,0 +1,4 @@ +SELECT * +FROM Enrolments +LEFT 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..7533456 100644 --- a/answers/exercise4.sql +++ b/answers/exercise4.sql @@ -0,0 +1 @@ +SELECT COUNTRY, COUNT(COUNTRY) AS STUDENT_PER_COUNTRY FROM STUDENTS GROUP BY COUNTRY; \ No newline at end of file diff --git a/answers/exercise5.sql b/answers/exercise5.sql index e69de29..f0c02b6 100644 --- a/answers/exercise5.sql +++ b/answers/exercise5.sql @@ -0,0 +1 @@ +SELECT COUNTRY, COUNT(COUNTRY) AS STUDENTS_PER_COUNTRY FROM STUDENTS GROUP BY COUNTRY ORDER BY COUNTRY ASC; \ No newline at end of file diff --git a/answers/exercise6.sql b/answers/exercise6.sql index e69de29..3bceec3 100644 --- a/answers/exercise6.sql +++ b/answers/exercise6.sql @@ -0,0 +1 @@ +SELECT COUNTRY, COUNT(COUNTRY) AS STUDENTS_PER_COUNTRY FROM STUDENTS GROUP BY COUNTRY HAVING STUDENTS_PER_COUNTRY > 10 ORDER BY STUDENTS_PER_COUNTRY; \ No newline at end of file