From 606d3b36b63491ede3656a8e7fd708eff3b0c5ac Mon Sep 17 00:00:00 2001 From: Jbanksalpha <78812718+Jbanksalpha@users.noreply.github.com> Date: Sat, 3 Apr 2021 15:26:58 -0400 Subject: [PATCH] filled out build and destroy lab --- 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/exercise19.sql | 1 + answers/exercise2.sql | 1 + answers/exercise20.sql | 1 + answers/exercise3.sql | 1 + answers/exercise4.sql | 1 + answers/exercise5.sql | 2 ++ answers/exercise6.sql | 1 + answers/exercise7.sql | 1 + answers/exercise8.sql | 1 + answers/exercise9.sql | 1 + 19 files changed, 20 insertions(+) diff --git a/answers/exercise1.sql b/answers/exercise1.sql index e69de29..d6b45a1 100644 --- a/answers/exercise1.sql +++ b/answers/exercise1.sql @@ -0,0 +1 @@ +mysql> CREATE DATABASE myNewDB; diff --git a/answers/exercise10.sql b/answers/exercise10.sql index e69de29..04c87e8 100644 --- a/answers/exercise10.sql +++ b/answers/exercise10.sql @@ -0,0 +1 @@ +SELECT City 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..3d56eb0 100644 --- a/answers/exercise11.sql +++ b/answers/exercise11.sql @@ -0,0 +1 @@ +SELECT * FROM Students ORDER BY City; \ 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..3472ce2 100644 --- a/answers/exercise13.sql +++ b/answers/exercise13.sql @@ -0,0 +1 @@ +SELECT * FROM Students ORDER BY Country 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..c9908f4 100644 --- a/answers/exercise15.sql +++ b/answers/exercise15.sql @@ -0,0 +1 @@ +SELECT PostalCode FROM Students; \ No newline at end of file diff --git a/answers/exercise16.sql b/answers/exercise16.sql index e69de29..c6e01de 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/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..636bdad 100644 --- a/answers/exercise2.sql +++ b/answers/exercise2.sql @@ -0,0 +1 @@ +mysql> DROP DATABASE myNewDB; 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 diff --git a/answers/exercise3.sql b/answers/exercise3.sql index e69de29..9685a83 100644 --- a/answers/exercise3.sql +++ b/answers/exercise3.sql @@ -0,0 +1 @@ +CREATE TABLE Users (UserID INTEGER PRIMARY KEY NOT NULL AUTO_INCREMENT, LastName VARCHAR(255), FirstName VARCHAR (255), Address VARCHAR(255), City VARCHAR(255)); diff --git a/answers/exercise4.sql b/answers/exercise4.sql index e69de29..d7ac35d 100644 --- a/answers/exercise4.sql +++ b/answers/exercise4.sql @@ -0,0 +1 @@ +mysql> DROP TABLE Users; \ No newline at end of file diff --git a/answers/exercise5.sql b/answers/exercise5.sql index e69de29..7ebee74 100644 --- a/answers/exercise5.sql +++ b/answers/exercise5.sql @@ -0,0 +1,2 @@ +TRUNCATE TABLE users; + diff --git a/answers/exercise6.sql b/answers/exercise6.sql index e69de29..25ddf6d 100644 --- a/answers/exercise6.sql +++ b/answers/exercise6.sql @@ -0,0 +1 @@ +ALTER TABLE Users ADD COLUMN Birthday DATE; diff --git a/answers/exercise7.sql b/answers/exercise7.sql index e69de29..550ea79 100644 --- a/answers/exercise7.sql +++ b/answers/exercise7.sql @@ -0,0 +1 @@ +ALTER TABLE Users DROP COLUMN Birthday; \ No newline at end of file diff --git a/answers/exercise8.sql b/answers/exercise8.sql index e69de29..076a9ee 100644 --- a/answers/exercise8.sql +++ b/answers/exercise8.sql @@ -0,0 +1 @@ +INSERT INTO Students(StudentName, Address, PostalCode, Country) VALUES ('Jane Doe', '57 Union st', 'G13RB', 'Glasgow, Scotland'); \ No newline at end of file diff --git a/answers/exercise9.sql b/answers/exercise9.sql index e69de29..9d69948 100644 --- a/answers/exercise9.sql +++ b/answers/exercise9.sql @@ -0,0 +1 @@ +SELECT City FROM Students WHERE NOT 'Philadelphia';