Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Did a little SQL The Other Dayyyyy #19

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added .DS_Store
Binary file not shown.
1 change: 1 addition & 0 deletions answers/exercise1.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
create schema myNewDB;
1 change: 1 addition & 0 deletions answers/exercise10.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
select * from Students where City = 'Philadelphia' or 'Trenton';
1 change: 1 addition & 0 deletions answers/exercise11.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Select * from Students order by City ASC;
1 change: 1 addition & 0 deletions answers/exercise12.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Select * from Students order by City DESC;
1 change: 1 addition & 0 deletions answers/exercise13.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Select * from Students order by Country, City ASC;
1 change: 1 addition & 0 deletions answers/exercise14.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Select * from Students where PostalCode = null;
1 change: 1 addition & 0 deletions answers/exercise15.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Select * from Students where PostalCode <> null;
1 change: 1 addition & 0 deletions answers/exercise16.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Update Students Set City = 'Edinburgh';
1 change: 1 addition & 0 deletions answers/exercise17.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Update Students Set City = 'Edinburgh' Where Country = 'Scotland';
1 change: 1 addition & 0 deletions answers/exercise18.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Update Students Set City = 'Edinburgh', Country = 'Scotland' where StudentID = 35;
1 change: 1 addition & 0 deletions answers/exercise19.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
delete from Students where Country = 'Scotland';
1 change: 1 addition & 0 deletions answers/exercise2.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
drop database myNEWDB
1 change: 1 addition & 0 deletions answers/exercise20.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
truncate Students;
8 changes: 8 additions & 0 deletions answers/exercise3.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
create table Users
(
UserID int,
LastName VARCHAR(255),
FirstName VARCHAR(255),
Address VARCHAR(255),
City VARCHAR(255)
);
1 change: 1 addition & 0 deletions answers/exercise4.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
delete Users from myNewDB;
1 change: 1 addition & 0 deletions answers/exercise5.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
truncate table Users;
1 change: 1 addition & 0 deletions answers/exercise6.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
alter table Users add Birthday Date;
1 change: 1 addition & 0 deletions answers/exercise7.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
delete Birthday from Users;
2 changes: 2 additions & 0 deletions answers/exercise8.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
INSERT INTO Students (StudentName, Address, City, PostalCode, Country)
VALUES ('Jane Doe', '57 Union St', 'Glasgow', 'G13RB', 'Scotland');
1 change: 1 addition & 0 deletions answers/exercise9.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
select * from Students where City <> 'Philadelphia';