Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions answers/exercise1.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
CREATE TABLE Enrollment (
FirstName VARCHAR(255),
LastName VARCHAR(255),
Adress VARCHAR(255),
City VARCHAR(255),
StudentID VARCHAR(100),
Hobby VARCHAR (255),
Skills VARCHAR (255));

INSERT INTO Enrollment (
FirstName,
LastName,
Adress,
City,
StudentID,
Hobby,
Skills)
VALUES (
'John',
'Song',
'76 gggg St',
'Philly', '3',
'Games', 'Coding');

SELECT * FROM Enrollment
LEFT JOIN Students ON Enrollment.StudentID = Students.StudentID;

3 changes: 3 additions & 0 deletions answers/exercise2.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
SELECT * FROM Enrollment
INNER JOIN Students
ON Enrollment.StudentID = Students.StudentID;
3 changes: 3 additions & 0 deletions answers/exercise3.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
SELECT * FROM Enrollment
RIGHT JOIN Students
ON Enrollment.StudentID = Students.StudentID;
3 changes: 3 additions & 0 deletions answers/exercise4.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
SELECT COUNT(*), Country
FROM Students
GROUP BY Country;
3 changes: 3 additions & 0 deletions answers/exercise5.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
SELECT COUNT(*), Country FROM Students
GROUP BY Country
ORDER BY COUNT(*) DESC;
4 changes: 4 additions & 0 deletions answers/exercise6.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
SELECT Country, COUNT(*) FROM Students
GROUP BY Country
HAVING COUNT(*) > 10
ORDER BY COUNT(*);