From d758101e4025f8d43432487f411d220d7f6cbb0f Mon Sep 17 00:00:00 2001 From: Keerthana Srinivasan Date: Wed, 1 Dec 2021 01:40:25 -0500 Subject: [PATCH 1/2] finished first 3 --- answers/exercise1.sql | 2 ++ answers/exercise2.sql | 1 + answers/exercise3.sql | 2 ++ 3 files changed, 5 insertions(+) diff --git a/answers/exercise1.sql b/answers/exercise1.sql index e69de29..2831851 100644 --- a/answers/exercise1.sql +++ b/answers/exercise1.sql @@ -0,0 +1,2 @@ +CREATE SCHEMA myNewDB; +SHOW DATABASES; 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/exercise3.sql b/answers/exercise3.sql index e69de29..f49e834 100644 --- a/answers/exercise3.sql +++ b/answers/exercise3.sql @@ -0,0 +1,2 @@ +CREATE TABLE Usera(id INTEGER PRIMARY KEY NOT NULL AUTO_INCREMENT,name VARCHAR(255) NOT NULL,specialty ENUM('FRONT END','MIDDLE TIER','DATA TIER')); +describe Usera; From 3cfb0bd865a0bcadafc8cd46318b62c9ad7f5359 Mon Sep 17 00:00:00 2001 From: Keerthana Srinivasan Date: Sat, 4 Dec 2021 00:31:26 -0500 Subject: [PATCH 2/2] Completed --- 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/exercise2.sql | 2 +- answers/exercise3.sql | 4 ++-- answers/exercise4.sql | 1 + answers/exercise5.sql | 1 + answers/exercise6.sql | 1 + answers/exercise7.sql | 1 + answers/exercise9.sql | 1 + 13 files changed, 14 insertions(+), 3 deletions(-) diff --git a/answers/exercise10.sql b/answers/exercise10.sql index e69de29..771de32 100644 --- a/answers/exercise10.sql +++ b/answers/exercise10.sql @@ -0,0 +1 @@ +SELECT*FROM Students WHERE City ='Philidelphia' OR City='Trenton'; diff --git a/answers/exercise11.sql b/answers/exercise11.sql index e69de29..1540c71 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..8263213 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..80c1365 100644 --- a/answers/exercise13.sql +++ b/answers/exercise13.sql @@ -0,0 +1 @@ +SELECT*FROM Students ORDER BY Country,city; \ No newline at end of file diff --git a/answers/exercise14.sql b/answers/exercise14.sql index e69de29..e562e34 100644 --- a/answers/exercise14.sql +++ b/answers/exercise14.sql @@ -0,0 +1 @@ +SELECT * FROM Students WHERE PostalCode IS NULL; \ No newline at end of file diff --git a/answers/exercise15.sql b/answers/exercise15.sql index e69de29..f0ff0df 100644 --- a/answers/exercise15.sql +++ b/answers/exercise15.sql @@ -0,0 +1 @@ +SELECT * FROM Students WHERE PostalCode IS NOT NULL; \ No newline at end of file diff --git a/answers/exercise2.sql b/answers/exercise2.sql index e7487f3..2a59f03 100644 --- a/answers/exercise2.sql +++ b/answers/exercise2.sql @@ -1 +1 @@ -DROP DATABASE myNewDB; \ No newline at end of file +DROP Database myNewDB; \ No newline at end of file diff --git a/answers/exercise3.sql b/answers/exercise3.sql index f49e834..510fe00 100644 --- a/answers/exercise3.sql +++ b/answers/exercise3.sql @@ -1,2 +1,2 @@ -CREATE TABLE Usera(id INTEGER PRIMARY KEY NOT NULL AUTO_INCREMENT,name VARCHAR(255) NOT NULL,specialty ENUM('FRONT END','MIDDLE TIER','DATA TIER')); -describe Usera; +CREATE TABLE USERS (USERID int,LastName varchar(255),FirstName varchar(255),Address varchar(255),City varchar(255)); +describe USERS; \ No newline at end of file diff --git a/answers/exercise4.sql b/answers/exercise4.sql index e69de29..2f22b4c 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..966404d 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..ec0caeb 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..0dd231c 100644 --- a/answers/exercise7.sql +++ b/answers/exercise7.sql @@ -0,0 +1 @@ +DELETE FROM USERS WHERE Birthday; diff --git a/answers/exercise9.sql b/answers/exercise9.sql index e69de29..07dac2a 100644 --- a/answers/exercise9.sql +++ b/answers/exercise9.sql @@ -0,0 +1 @@ +SELECT * FROM Students WHERE NOT City = 'Philidelphia'; \ No newline at end of file