Assignment: SQL #2 Putting Data into the Database

advertisement
Assignment: SQL #2
Putting Data into the Database
To do this assignment, you will be working with the faculty and staff directory database that you used
for the in-class exercise (mxdirectdb). You can refer to that document for the database structure and
metadata.
Remember, you will need to log in using your account, and the directdb schema will reflect your
username. So if you are logging in as m45, the schema name for you will be m45directdb.
You will be further modifying the database using SQL UPDATE, INSERT, and DELETE statements where
appropriate according to the scenarios below. You may need more than one statement, especially if you
are changing multiple tables or performing multiple operations.
NOTE: Even if you use SQL Workbench to assist you in constructing the queries, you should be
prepared to come up with the syntax on your own without help! Always try doing this on your own!
Guidelines




You must submit your answers electronically in a single Word document. You can copy and paste
the SQL query and the results from SQL Workbench.
You must include your name at the top of the document.
Your answers should be emailed, as an attachment, to your instructor with the subject:
MIS2502: SQL Assignment #2
The email must be sent by the start of class the day the assignment is due.
If you do not follow these instructions, your assignment will be counted late.
Evaluation
Your submission will be graded based on the correctness of the SQL queries that update the database
according to each scenario.
Scenarios
1) Add the following new employees to the database (7 queries):
Full name
Full title
Office address
Phone
Email
Faculty or staff
Department(s)
David Short
Instructor and Director of
Student Advising
101 Alter Hall
215-204-9665
short@temple.edu
Both
Marketing and Supply
Chain Management
Dr. Liz Friedman
Associate Professor
Sara Hess
Associate Professor
655 Alter Hall
215-204-6834
liz@temple.edu
Faculty
Finance (primary)
Accounting
213 Caribou Hall
215-204-4254
shess@temple.edu
Faculty
Risk, Insurance, and
Health Care Management
2) Add this new building to the database (1 query):
Name: Tuttleman Learning Center
Address: 1210 West Berks Street
3) Remove Caribou Hall from the database (you added it in the in-class exercise) (1 query).
4) Now that you have removed Caribou Hall, there are people without offices. Re-assign the following
faculty to new addresses (2 queries):
Full name
New office address
Paul Beneficio
343 Tuttleman Learning Center
Sara Hess
400 Tuttleman Learning Center
5) So many of the faculty are using Skype at work that we want the database to now keep track of
employees’ Skype account names. Add a field to the facultystaff table called “SkypeID.” (1 query).
Now add entries for the SkypeID of the following employees (5 queries):
Full name
Michael McPeterson
Franklin Ogelvie
Joe Smith
Liz Friedman
Sara Hess
SkypeID
macpete
frogman
jsmith
lfriedman
sarahess
Download