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

Lab Finished #1

Open
wants to merge 20 commits 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
3 changes: 3 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions .idea/SQL.BuildAndDestroy.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

610 changes: 610 additions & 0 deletions .idea/dbnavigator.xml

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions answers/exercise1.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
CREATE DATABASE myNewDB;
2 changes: 2 additions & 0 deletions answers/exercise10.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
SELECT * FROM Students
WHERE City = 'Philadelphia' OR City = 'Trenton';
2 changes: 2 additions & 0 deletions answers/exercise11.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
SELECT * FROM Students
ORDER BY City;
2 changes: 2 additions & 0 deletions answers/exercise12.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
SELECT * FROM Students
ORDER BY City DESC;
2 changes: 2 additions & 0 deletions answers/exercise13.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
SELECT * FROM Students
ORDER BY Country, City;
2 changes: 2 additions & 0 deletions answers/exercise14.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
SELECT * FROM Students
WHERE PostalCode IS NULL;
2 changes: 2 additions & 0 deletions answers/exercise15.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
SELECT * FROM Students
WHERE PostalCode IS NOT NULL;
2 changes: 2 additions & 0 deletions answers/exercise16.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
UPDATE Students
Set City = 'Edinburgh';
3 changes: 3 additions & 0 deletions answers/exercise17.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Update Students
SET City = 'Edinburgh'
WHERE Country = 'Scotland';
3 changes: 3 additions & 0 deletions answers/exercise18.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
UPDATE Students
SET City = 'Edinburgh', Country = 'Scotland'
WHERE StudentID = 35;
2 changes: 2 additions & 0 deletions answers/exercise19.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
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 @@
DELETE FROM Students;
7 changes: 7 additions & 0 deletions answers/exercise3.sql
Original file line number Diff line number Diff line change
@@ -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)
);
1 change: 1 addition & 0 deletions answers/exercise4.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
DROP TABLE Users;
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;
3 changes: 3 additions & 0 deletions answers/exercise6.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
ALTER TABLE Users(
ADD Birtday DATE
);
2 changes: 2 additions & 0 deletions answers/exercise7.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ALTER TABLE Users
DROP COLUMN Birthday;
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
VALUES ('Jane Doe', '57 Union St', 'Glasgow', 'G13RB', 'Scotland');
2 changes: 2 additions & 0 deletions answers/exercise9.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
SELECT * FROM Students
WHERE NOT City = 'Philadelphia';