From 984a74432747ca4e212ed2438b7af25e67b95dd0 Mon Sep 17 00:00:00 2001 From: Brian Patterson Date: Sat, 30 Nov 2019 13:15:32 -0500 Subject: [PATCH] Completed --- answers/.idea/.gitignore | 3 +++ answers/.idea/answers.iml | 9 +++++++++ answers/.idea/misc.xml | 6 ++++++ answers/.idea/modules.xml | 8 ++++++++ answers/.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 | 6 ++++++ answers/exercise4.sql | 1 + answers/exercise5.sql | 1 + answers/exercise6.sql | 1 + answers/exercise7.sql | 1 + answers/exercise8.sql | 7 +++++++ answers/exercise9.sql | 1 + 25 files changed, 63 insertions(+) create mode 100644 answers/.idea/.gitignore create mode 100644 answers/.idea/answers.iml create mode 100644 answers/.idea/misc.xml create mode 100644 answers/.idea/modules.xml create mode 100644 answers/.idea/vcs.xml diff --git a/answers/.idea/.gitignore b/answers/.idea/.gitignore new file mode 100644 index 0000000..0e40fe8 --- /dev/null +++ b/answers/.idea/.gitignore @@ -0,0 +1,3 @@ + +# Default ignored files +/workspace.xml \ No newline at end of file diff --git a/answers/.idea/answers.iml b/answers/.idea/answers.iml new file mode 100644 index 0000000..d6ebd48 --- /dev/null +++ b/answers/.idea/answers.iml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/answers/.idea/misc.xml b/answers/.idea/misc.xml new file mode 100644 index 0000000..28a804d --- /dev/null +++ b/answers/.idea/misc.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/answers/.idea/modules.xml b/answers/.idea/modules.xml new file mode 100644 index 0000000..3272c1a --- /dev/null +++ b/answers/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/answers/.idea/vcs.xml b/answers/.idea/vcs.xml new file mode 100644 index 0000000..6c0b863 --- /dev/null +++ b/answers/.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..dfbfede 100644 --- a/answers/exercise1.sql +++ b/answers/exercise1.sql @@ -0,0 +1 @@ +CREATE database myNewDB; \ No newline at end of file diff --git a/answers/exercise10.sql b/answers/exercise10.sql index e69de29..677ee23 100644 --- a/answers/exercise10.sql +++ b/answers/exercise10.sql @@ -0,0 +1 @@ +SELECT * FROM Users WHERE City = Philadelphia|| City = Trenton; diff --git a/answers/exercise11.sql b/answers/exercise11.sql index e69de29..850eb10 100644 --- a/answers/exercise11.sql +++ b/answers/exercise11.sql @@ -0,0 +1 @@ +SELECT * FROM Users ORDER BY City; \ No newline at end of file diff --git a/answers/exercise12.sql b/answers/exercise12.sql index e69de29..7309b0d 100644 --- a/answers/exercise12.sql +++ b/answers/exercise12.sql @@ -0,0 +1 @@ +SELECT * FROM Users ORDER BY City DESC; \ No newline at end of file diff --git a/answers/exercise13.sql b/answers/exercise13.sql index e69de29..aa15c7d 100644 --- a/answers/exercise13.sql +++ b/answers/exercise13.sql @@ -0,0 +1 @@ +SELECT * FROM Users WHERE ORDER BY City, Country; \ No newline at end of file diff --git a/answers/exercise14.sql b/answers/exercise14.sql index e69de29..d838165 100644 --- a/answers/exercise14.sql +++ b/answers/exercise14.sql @@ -0,0 +1 @@ +SELECT * FROM WHERE PostalCode = NULL; \ No newline at end of file diff --git a/answers/exercise15.sql b/answers/exercise15.sql index e69de29..7a5fd80 100644 --- a/answers/exercise15.sql +++ b/answers/exercise15.sql @@ -0,0 +1 @@ +SELECT * FROM WHERE PostalCode = NOT NULL; \ No newline at end of file diff --git a/answers/exercise16.sql b/answers/exercise16.sql index e69de29..1802291 100644 --- a/answers/exercise16.sql +++ b/answers/exercise16.sql @@ -0,0 +1 @@ +UPDATE Users SET City = Edinburgh; \ No newline at end of file diff --git a/answers/exercise17.sql b/answers/exercise17.sql index e69de29..1f12410 100644 --- a/answers/exercise17.sql +++ b/answers/exercise17.sql @@ -0,0 +1 @@ +UPDATE Users SET City = Edinburgh WHERE City = Scotland; \ No newline at end of file diff --git a/answers/exercise18.sql b/answers/exercise18.sql index e69de29..123c7eb 100644 --- a/answers/exercise18.sql +++ b/answers/exercise18.sql @@ -0,0 +1 @@ +UPDATE Users 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..7e2e939 100644 --- a/answers/exercise19.sql +++ b/answers/exercise19.sql @@ -0,0 +1 @@ +DELETE FROM Users 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..a2f3a09 100644 --- a/answers/exercise20.sql +++ b/answers/exercise20.sql @@ -0,0 +1 @@ +TRUNCATE USERS; \ No newline at end of file diff --git a/answers/exercise3.sql b/answers/exercise3.sql index e69de29..5e2fdcd 100644 --- a/answers/exercise3.sql +++ b/answers/exercise3.sql @@ -0,0 +1,6 @@ +CREATE TABLE Users( +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..81ce280 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..dbc47f6 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..17e2513 100644 --- a/answers/exercise7.sql +++ b/answers/exercise7.sql @@ -0,0 +1 @@ +ALTER TABLE Users DROP Birthday DATE; \ No newline at end of file diff --git a/answers/exercise8.sql b/answers/exercise8.sql index e69de29..7a36650 100644 --- a/answers/exercise8.sql +++ b/answers/exercise8.sql @@ -0,0 +1,7 @@ +INSERT INTO Users ( +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..fa9ced7 100644 --- a/answers/exercise9.sql +++ b/answers/exercise9.sql @@ -0,0 +1 @@ +SELECT * FROM Users NOT Philadelphia; \ No newline at end of file