diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000..4756ced Binary files /dev/null and b/.DS_Store differ diff --git a/answers/exercise1.sql b/answers/exercise1.sql index e69de29..9a1a4d3 100644 --- a/answers/exercise1.sql +++ b/answers/exercise1.sql @@ -0,0 +1 @@ +create schema myNewDB; diff --git a/answers/exercise10.sql b/answers/exercise10.sql index e69de29..7d2514b 100644 --- a/answers/exercise10.sql +++ b/answers/exercise10.sql @@ -0,0 +1 @@ +select * from Students where City = 'Philadelphia' or 'Trenton'; \ No newline at end of file diff --git a/answers/exercise11.sql b/answers/exercise11.sql index e69de29..7cd5e7f 100644 --- a/answers/exercise11.sql +++ b/answers/exercise11.sql @@ -0,0 +1 @@ +Select * from Students order by City ASC; \ No newline at end of file diff --git a/answers/exercise12.sql b/answers/exercise12.sql index e69de29..9adaf01 100644 --- a/answers/exercise12.sql +++ b/answers/exercise12.sql @@ -0,0 +1 @@ +Select * from Students order by City DESC; \ No newline at end of file diff --git a/answers/exercise13.sql b/answers/exercise13.sql index e69de29..b11c8f0 100644 --- a/answers/exercise13.sql +++ b/answers/exercise13.sql @@ -0,0 +1 @@ +Select * from Students order by Country, City ASC; \ No newline at end of file diff --git a/answers/exercise14.sql b/answers/exercise14.sql index e69de29..2c23b28 100644 --- a/answers/exercise14.sql +++ b/answers/exercise14.sql @@ -0,0 +1 @@ +Select * from Students where PostalCode = null; \ No newline at end of file diff --git a/answers/exercise15.sql b/answers/exercise15.sql index e69de29..759d7fa 100644 --- a/answers/exercise15.sql +++ b/answers/exercise15.sql @@ -0,0 +1 @@ +Select * from Students where PostalCode <> null; \ No newline at end of file diff --git a/answers/exercise16.sql b/answers/exercise16.sql index e69de29..edf0674 100644 --- a/answers/exercise16.sql +++ b/answers/exercise16.sql @@ -0,0 +1 @@ +Update Students Set City = 'Edinburgh'; \ No newline at end of file diff --git a/answers/exercise17.sql b/answers/exercise17.sql index e69de29..c0e6360 100644 --- a/answers/exercise17.sql +++ b/answers/exercise17.sql @@ -0,0 +1 @@ +Update Students Set City = 'Edinburgh' Where Country = 'Scotland'; \ No newline at end of file diff --git a/answers/exercise18.sql b/answers/exercise18.sql index e69de29..060cfa5 100644 --- a/answers/exercise18.sql +++ b/answers/exercise18.sql @@ -0,0 +1 @@ +Update Students Set City = 'Edinburgh', Country = 'Scotland' where StudentID = 35; \ No newline at end of file diff --git a/answers/exercise19.sql b/answers/exercise19.sql index e69de29..6ef22fd 100644 --- a/answers/exercise19.sql +++ b/answers/exercise19.sql @@ -0,0 +1 @@ +delete from Students where Country = 'Scotland'; \ No newline at end of file diff --git a/answers/exercise2.sql b/answers/exercise2.sql index e69de29..b529a1e 100644 --- a/answers/exercise2.sql +++ b/answers/exercise2.sql @@ -0,0 +1 @@ +drop database myNEWDB \ No newline at end of file diff --git a/answers/exercise20.sql b/answers/exercise20.sql index e69de29..f0d330e 100644 --- a/answers/exercise20.sql +++ b/answers/exercise20.sql @@ -0,0 +1 @@ +truncate Students; \ No newline at end of file diff --git a/answers/exercise3.sql b/answers/exercise3.sql index e69de29..883c93f 100644 --- a/answers/exercise3.sql +++ b/answers/exercise3.sql @@ -0,0 +1,8 @@ +create table Users +( + UserID int, + LastName VARCHAR(255), + FirstName VARCHAR(255), + Address VARCHAR(255), + City VARCHAR(255) +); diff --git a/answers/exercise4.sql b/answers/exercise4.sql index e69de29..1623a52 100644 --- a/answers/exercise4.sql +++ b/answers/exercise4.sql @@ -0,0 +1 @@ +delete Users from myNewDB; \ No newline at end of file diff --git a/answers/exercise5.sql b/answers/exercise5.sql index e69de29..c55f726 100644 --- a/answers/exercise5.sql +++ b/answers/exercise5.sql @@ -0,0 +1 @@ +truncate table Users; \ No newline at end of file diff --git a/answers/exercise6.sql b/answers/exercise6.sql index e69de29..ef1d98d 100644 --- a/answers/exercise6.sql +++ b/answers/exercise6.sql @@ -0,0 +1 @@ +alter table Users add Birthday Date; \ No newline at end of file diff --git a/answers/exercise7.sql b/answers/exercise7.sql index e69de29..4a49193 100644 --- a/answers/exercise7.sql +++ b/answers/exercise7.sql @@ -0,0 +1 @@ +delete Birthday from Users; \ No newline at end of file diff --git a/answers/exercise8.sql b/answers/exercise8.sql index e69de29..62c2a12 100644 --- a/answers/exercise8.sql +++ b/answers/exercise8.sql @@ -0,0 +1,2 @@ +INSERT INTO Students (StudentName, Address, City, PostalCode, Country) +VALUES ('Jane Doe', '57 Union St', 'Glasgow', 'G13RB', 'Scotland'); \ No newline at end of file diff --git a/answers/exercise9.sql b/answers/exercise9.sql index e69de29..cf11df7 100644 --- a/answers/exercise9.sql +++ b/answers/exercise9.sql @@ -0,0 +1 @@ +select * from Students where City <> 'Philadelphia'; \ No newline at end of file