From 6f26ba7b17ce7b8e5f3a1cb8785ac57d9479a9d4 Mon Sep 17 00:00:00 2001 From: jgiroso Date: Wed, 28 Jul 2021 21:08:05 -0400 Subject: [PATCH] lab complete --- .DS_Store | Bin 0 -> 6148 bytes .idea/.gitignore | 3 +++ .idea/SQL.BuildAndDestroy.iml | 9 +++++++++ .idea/misc.xml | 6 ++++++ .idea/modules.xml | 8 ++++++++ .idea/vcs.xml | 6 ++++++ answers/exercise1.sql | 1 + answers/exercise10.sql | 1 + answers/exercise11.sql | 1 + answers/exercise12.sql | 1 + answers/exercise13.sql | 1 + answers/exercise14.sql | 1 + answers/exercise15.sql | 1 + answers/exercise16.sql | 1 + answers/exercise17.sql | 1 + answers/exercise18.sql | 1 + answers/exercise19.sql | 1 + answers/exercise2.sql | 1 + answers/exercise20.sql | 1 + answers/exercise3.sql | 7 +++++++ answers/exercise4.sql | 1 + answers/exercise5.sql | 1 + answers/exercise6.sql | 1 + answers/exercise7.sql | 1 + answers/exercise8.sql | 2 ++ answers/exercise9.sql | 1 + 26 files changed, 59 insertions(+) create mode 100644 .DS_Store create mode 100644 .idea/.gitignore create mode 100644 .idea/SQL.BuildAndDestroy.iml create mode 100644 .idea/misc.xml create mode 100644 .idea/modules.xml create mode 100644 .idea/vcs.xml diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..64cb3200528ff0b15c6941e878f56c2bb94bef37 GIT binary patch literal 6148 zcmeHK!EO^V5FNLnae@#zAOQy?U${k8(n1jjq$Q+>9*_`=-~g!IWh1)Mb{%CmtRMvK zcfd#RAN&BH18;0obrU!iLFJLgZ|s?|<)`&{O+;cePliN2B9c(XRu|20g#D~*vf)PB zKw;*X(2RYb`piifNpg z=x^~fON(+a_%1d!TbH)lQg&tcO80emtgEn$%6T!0W-qz-Br1<%XFtyWY|JBPiSi^b0H-rc_19qujrYH@#O z&{ubM_m<0!yncK5;Na-w{fEWJ<)_bPCnQj{j9hj23%?{0d8EeE|SiTy&Tw$w2PiY@t(wH6tx4~S} + + + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..639900d --- /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..9bfba77 --- /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..ed94dd5 100644 --- a/answers/exercise1.sql +++ b/answers/exercise1.sql @@ -0,0 +1 @@ +CREATE SCHEMA myNewDB; \ No newline at end of file diff --git a/answers/exercise10.sql b/answers/exercise10.sql index e69de29..d5bf9fa 100644 --- a/answers/exercise10.sql +++ b/answers/exercise10.sql @@ -0,0 +1 @@ +SELECT * FROM Students WHERE City = 'Middletown' | 'Newark'; \ No newline at end of file diff --git a/answers/exercise11.sql b/answers/exercise11.sql index e69de29..6b94b42 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..387247f 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..3fde6db 100644 --- a/answers/exercise13.sql +++ b/answers/exercise13.sql @@ -0,0 +1 @@ +SELECT * FROM Students ORDER BY Country ASC, City ASC; \ No newline at end of file diff --git a/answers/exercise14.sql b/answers/exercise14.sql index e69de29..d606be1 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..465b606 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..39d01b2 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..475bb10 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..2524ddc 100644 --- a/answers/exercise18.sql +++ b/answers/exercise18.sql @@ -0,0 +1 @@ +UPDATE Students SET City = 'Edinburgh', Country = 'Scotland' WHERE ID = 35; \ No newline at end of file diff --git a/answers/exercise19.sql b/answers/exercise19.sql index e69de29..2cdd0fd 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..e7487f3 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..2e9be8f 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..88fbb4a 100644 --- a/answers/exercise3.sql +++ b/answers/exercise3.sql @@ -0,0 +1,7 @@ +CREATE TABLE Users( + UserID INTEGER, + LastName VARCHAR(255), + FirstName VARCHAR(255), + Address VARCHAR(255), + City VARCHAR(255) +); \ No newline at end of file diff --git a/answers/exercise4.sql b/answers/exercise4.sql index e69de29..fe6a7f5 100644 --- a/answers/exercise4.sql +++ b/answers/exercise4.sql @@ -0,0 +1 @@ +DROP TABLE Users; \ No newline at end of file diff --git a/answers/exercise5.sql b/answers/exercise5.sql index e69de29..12321ad 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..9782ded 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..b478887 100644 --- a/answers/exercise7.sql +++ b/answers/exercise7.sql @@ -0,0 +1 @@ +ALTER TABLE Users DROP Birthday; \ No newline at end of file diff --git a/answers/exercise8.sql b/answers/exercise8.sql index e69de29..8e6925c 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..8e7f9e6 100644 --- a/answers/exercise9.sql +++ b/answers/exercise9.sql @@ -0,0 +1 @@ +SELECT * FROM Students WHERE City <> 'Philadelphia'; \ No newline at end of file