From b2c670a211a63f43e3871c61b90a42e8d99e24b8 Mon Sep 17 00:00:00 2001 From: Jake Lawhorne Date: Sun, 26 Mar 2023 13:15:48 -0400 Subject: [PATCH 01/20] Finished exercise 1 --- .idea/.gitignore | 3 + .idea/SQL.BuildAndDestroy.iml | 9 + .idea/dbnavigator.xml | 604 ++++++++++++++++++++++++++++++++++ .idea/misc.xml | 6 + .idea/modules.xml | 8 + .idea/vcs.xml | 6 + answers/exercise1.sql | 1 + 7 files changed, 637 insertions(+) create mode 100644 .idea/.gitignore create mode 100644 .idea/SQL.BuildAndDestroy.iml create mode 100644 .idea/dbnavigator.xml create mode 100644 .idea/misc.xml create mode 100644 .idea/modules.xml create mode 100644 .idea/vcs.xml diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..26d3352 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,3 @@ +# Default ignored files +/shelf/ +/workspace.xml diff --git a/.idea/SQL.BuildAndDestroy.iml b/.idea/SQL.BuildAndDestroy.iml new file mode 100644 index 0000000..d6ebd48 --- /dev/null +++ b/.idea/SQL.BuildAndDestroy.iml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/.idea/dbnavigator.xml b/.idea/dbnavigator.xml new file mode 100644 index 0000000..dd9dcf6 --- /dev/null +++ b/.idea/dbnavigator.xml @@ -0,0 +1,604 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
\ 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..07c2318 100644 --- a/answers/exercise1.sql +++ b/answers/exercise1.sql @@ -0,0 +1 @@ +CREATE DATABASE myNewDB; \ No newline at end of file From c0c11df048fe8af9d57d1f999b6f5ea9f8dcc10f Mon Sep 17 00:00:00 2001 From: Jake Lawhorne Date: Sun, 26 Mar 2023 13:19:39 -0400 Subject: [PATCH 02/20] Completed exercise 2 --- answers/exercise2.sql | 1 + 1 file changed, 1 insertion(+) 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 From 2d287e1805f01ee3c89049912b66064e9a67e789 Mon Sep 17 00:00:00 2001 From: Jake Lawhorne Date: Sun, 26 Mar 2023 13:26:51 -0400 Subject: [PATCH 03/20] Completed exercise 3 --- answers/exercise3.sql | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/answers/exercise3.sql b/answers/exercise3.sql index e69de29..669514f 100644 --- a/answers/exercise3.sql +++ b/answers/exercise3.sql @@ -0,0 +1,7 @@ +CREATE TABLE Users( +UserID int NOT NULL AUTO_INCREMENT, +LastName varchar(255) NOT NULL, +firstName varchar(255), +address varchar(255), +city varchar(255) +); \ No newline at end of file From 62ab19a4fac53d2f63fd9afe248470eb980b93fd Mon Sep 17 00:00:00 2001 From: Jake Lawhorne Date: Sun, 26 Mar 2023 13:27:56 -0400 Subject: [PATCH 04/20] completed exercise 4 --- answers/exercise4.sql | 1 + 1 file changed, 1 insertion(+) 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 From 72887782f57dbd43979f1dae1bed19ea4addda7d Mon Sep 17 00:00:00 2001 From: Jake Lawhorne Date: Sun, 26 Mar 2023 13:29:47 -0400 Subject: [PATCH 05/20] Completed exercise 5 --- .idea/dbnavigator.xml | 6 ++++++ answers/exercise5.sql | 1 + 2 files changed, 7 insertions(+) diff --git a/.idea/dbnavigator.xml b/.idea/dbnavigator.xml index dd9dcf6..b41d12f 100644 --- a/.idea/dbnavigator.xml +++ b/.idea/dbnavigator.xml @@ -25,10 +25,16 @@ + + + + + + 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 From cecf647320d8e17061f730365bb64617ce60e8d0 Mon Sep 17 00:00:00 2001 From: Jake Lawhorne Date: Sun, 26 Mar 2023 13:31:23 -0400 Subject: [PATCH 06/20] Completed exercise 5 --- answers/exercise6.sql | 3 +++ 1 file changed, 3 insertions(+) diff --git a/answers/exercise6.sql b/answers/exercise6.sql index e69de29..aa3e9d7 100644 --- a/answers/exercise6.sql +++ b/answers/exercise6.sql @@ -0,0 +1,3 @@ +ALTER TABLE Users( +ADD Birtday DATE +); \ No newline at end of file From 0937e5723bb90a9f2a9912556fd9161fae3a5f3a Mon Sep 17 00:00:00 2001 From: Jake Lawhorne Date: Sun, 26 Mar 2023 13:33:20 -0400 Subject: [PATCH 07/20] Completed exercise7 --- answers/exercise7.sql | 2 ++ 1 file changed, 2 insertions(+) diff --git a/answers/exercise7.sql b/answers/exercise7.sql index e69de29..b0e8666 100644 --- a/answers/exercise7.sql +++ b/answers/exercise7.sql @@ -0,0 +1,2 @@ +ALTER TABLE Users +DROP COLUMN Birthday; \ No newline at end of file From 6780c7794700a5f896ffae842d55a94668fafd39 Mon Sep 17 00:00:00 2001 From: Jake Lawhorne Date: Sun, 26 Mar 2023 13:41:47 -0400 Subject: [PATCH 08/20] Exercise 8 complete --- answers/exercise8.sql | 2 ++ 1 file changed, 2 insertions(+) diff --git a/answers/exercise8.sql b/answers/exercise8.sql index e69de29..75590c0 100644 --- a/answers/exercise8.sql +++ b/answers/exercise8.sql @@ -0,0 +1,2 @@ +INSERT INTO Students +VALUES ('Jane Doe', '57 Union St', 'Glasgow', 'G13RB', 'Scotland'); \ No newline at end of file From abfe687926a9fd8a529ccf06d0c075acd182242b Mon Sep 17 00:00:00 2001 From: Jake Lawhorne Date: Sun, 26 Mar 2023 13:58:15 -0400 Subject: [PATCH 09/20] Completed exercise 9 --- answers/exercise9.sql | 2 ++ 1 file changed, 2 insertions(+) diff --git a/answers/exercise9.sql b/answers/exercise9.sql index e69de29..681e8b3 100644 --- a/answers/exercise9.sql +++ b/answers/exercise9.sql @@ -0,0 +1,2 @@ +SELECT * FROM Students +WHERE NOT City = 'Philadelphia'; \ No newline at end of file From 3577f4e4b8f5947cbf9812c7aa9258da762add64 Mon Sep 17 00:00:00 2001 From: Jake Lawhorne Date: Sun, 26 Mar 2023 13:59:43 -0400 Subject: [PATCH 10/20] Exercise10 completed --- answers/exercise10.sql | 2 ++ 1 file changed, 2 insertions(+) diff --git a/answers/exercise10.sql b/answers/exercise10.sql index e69de29..31c02e0 100644 --- a/answers/exercise10.sql +++ b/answers/exercise10.sql @@ -0,0 +1,2 @@ +SELECT * FROM Students +WHERE City = 'Philadelphia' OR City = 'Trenton'; \ No newline at end of file From 320bea818463116f62d8c9faf45797852389ceba Mon Sep 17 00:00:00 2001 From: Jake Lawhorne Date: Sun, 26 Mar 2023 14:03:23 -0400 Subject: [PATCH 11/20] exercise11 completed --- answers/exercise11.sql | 2 ++ 1 file changed, 2 insertions(+) diff --git a/answers/exercise11.sql b/answers/exercise11.sql index e69de29..5337c02 100644 --- a/answers/exercise11.sql +++ b/answers/exercise11.sql @@ -0,0 +1,2 @@ +SELECT * FROM Students +ORDER BY City; \ No newline at end of file From aba9656a956124f4ac0802c3c2100d898ad94e58 Mon Sep 17 00:00:00 2001 From: Jake Lawhorne Date: Sun, 26 Mar 2023 14:04:11 -0400 Subject: [PATCH 12/20] exercise12 completed --- answers/exercise12.sql | 2 ++ 1 file changed, 2 insertions(+) diff --git a/answers/exercise12.sql b/answers/exercise12.sql index e69de29..7e22273 100644 --- a/answers/exercise12.sql +++ b/answers/exercise12.sql @@ -0,0 +1,2 @@ +SELECT * FROM Students +ORDER BY City DESC; \ No newline at end of file From 3b75d05228eaab52d6a8db179ed0fe9a8f9add05 Mon Sep 17 00:00:00 2001 From: Jake Lawhorne Date: Sun, 26 Mar 2023 14:05:49 -0400 Subject: [PATCH 13/20] exercise13 completed --- answers/exercise13.sql | 2 ++ 1 file changed, 2 insertions(+) diff --git a/answers/exercise13.sql b/answers/exercise13.sql index e69de29..30c8123 100644 --- a/answers/exercise13.sql +++ b/answers/exercise13.sql @@ -0,0 +1,2 @@ +SELECT * FROM Students +ORDER BY Country, City; \ No newline at end of file From 70a5d8b45108bebaf4dbab8105f2d8abf71b5c26 Mon Sep 17 00:00:00 2001 From: Jake Lawhorne Date: Sun, 26 Mar 2023 14:07:26 -0400 Subject: [PATCH 14/20] exercise14 completed --- answers/exercise14.sql | 2 ++ 1 file changed, 2 insertions(+) diff --git a/answers/exercise14.sql b/answers/exercise14.sql index e69de29..30e8d38 100644 --- a/answers/exercise14.sql +++ b/answers/exercise14.sql @@ -0,0 +1,2 @@ +SELECT * FROM Students +WHERE PostalCode IS NULL; \ No newline at end of file From fd9fbb1892e93d0e019c9581fd5160ac980431ba Mon Sep 17 00:00:00 2001 From: Jake Lawhorne Date: Sun, 26 Mar 2023 14:08:18 -0400 Subject: [PATCH 15/20] exercise15 completed --- answers/exercise15.sql | 2 ++ 1 file changed, 2 insertions(+) diff --git a/answers/exercise15.sql b/answers/exercise15.sql index e69de29..fde2ca1 100644 --- a/answers/exercise15.sql +++ b/answers/exercise15.sql @@ -0,0 +1,2 @@ +SELECT * FROM Students +WHERE PostalCode IS NOT NULL; \ No newline at end of file From 46f8b04c7393add109555c475b5d0b4a45c4b326 Mon Sep 17 00:00:00 2001 From: Jake Lawhorne Date: Sun, 26 Mar 2023 14:10:28 -0400 Subject: [PATCH 16/20] exercise16 finished --- answers/exercise16.sql | 2 ++ 1 file changed, 2 insertions(+) diff --git a/answers/exercise16.sql b/answers/exercise16.sql index e69de29..a89e532 100644 --- a/answers/exercise16.sql +++ b/answers/exercise16.sql @@ -0,0 +1,2 @@ +UPDATE Students +Set City = 'Edinburgh'; \ No newline at end of file From ec4600b1f0af8cb927944b49f1b34ead9fffd680 Mon Sep 17 00:00:00 2001 From: Jake Lawhorne Date: Sun, 26 Mar 2023 14:11:39 -0400 Subject: [PATCH 17/20] exercise17 completed --- answers/exercise17.sql | 3 +++ 1 file changed, 3 insertions(+) diff --git a/answers/exercise17.sql b/answers/exercise17.sql index e69de29..4c8668a 100644 --- a/answers/exercise17.sql +++ b/answers/exercise17.sql @@ -0,0 +1,3 @@ +Update Students +SET City = 'Edinburgh' +WHERE Country = 'Scotland'; \ No newline at end of file From fe2e2960cdb354e26ba0b9633fba126085b181e5 Mon Sep 17 00:00:00 2001 From: Jake Lawhorne Date: Sun, 26 Mar 2023 14:14:21 -0400 Subject: [PATCH 18/20] exercise18 completed --- answers/exercise18.sql | 3 +++ 1 file changed, 3 insertions(+) diff --git a/answers/exercise18.sql b/answers/exercise18.sql index e69de29..edf2e13 100644 --- a/answers/exercise18.sql +++ b/answers/exercise18.sql @@ -0,0 +1,3 @@ +UPDATE Students +SET City = 'Edinburgh', Country = 'Scotland' +WHERE StudentID = 35; \ No newline at end of file From 12820a059a5a90477da8d764f52f86ad151255cb Mon Sep 17 00:00:00 2001 From: Jake Lawhorne Date: Sun, 26 Mar 2023 14:15:59 -0400 Subject: [PATCH 19/20] exercise19 complete --- answers/exercise19.sql | 2 ++ 1 file changed, 2 insertions(+) diff --git a/answers/exercise19.sql b/answers/exercise19.sql index e69de29..b5705f5 100644 --- a/answers/exercise19.sql +++ b/answers/exercise19.sql @@ -0,0 +1,2 @@ +DELETE FROM Students +WHERE Country = 'Scotland'; \ No newline at end of file From c14db3356e423aa0913f1eefce9b35bfc7f6d5ff Mon Sep 17 00:00:00 2001 From: Jake Lawhorne Date: Sun, 26 Mar 2023 14:17:38 -0400 Subject: [PATCH 20/20] exercise20 completed --- answers/exercise20.sql | 1 + 1 file changed, 1 insertion(+) diff --git a/answers/exercise20.sql b/answers/exercise20.sql index e69de29..5c66fd1 100644 --- a/answers/exercise20.sql +++ b/answers/exercise20.sql @@ -0,0 +1 @@ +DELETE FROM Students; \ No newline at end of file