Question: Use the 4 tables in the attachment as reference, write ONE SQL script to handle the following three functions: create, update, and delete. Create Create
Use the 4 tables in the attachment as reference, write ONE SQL script to handle the following three functions: create, update, and delete.
- Create
Create a database named IS3400. Then create 4 tables as shown in the attachment. The first column in each table is the primary key of that table. All primary keys should be varchar type. For other columns, use your best judgment to decide their value types. Also use your best judgement to define the appropriate constraints, i.e. primary key, foreign key, not null, and unique. Insert ALL records in the attachment to the 4 tables that you created.
- Update
Update Student Joe Smith to Joseph Smith. And update his email to be joseph@uccs.edu.
- Delete
Professor Jane Jobs has left the university. Delete her record in the Professor table.
At the very beginning of the SQL script file, write the following lines as comments.
# By Joe Smith (replace it with your name)
# Homework 1, xx/xx/xxxx (replace it with the submission date)
# Create, Update, and Delete
Save your code as HW1.sql.
Attachment
Student
| SID | SFName | SLName | SEmail | SPhone |
| 1111 | James | Marks | jmas@uccs.edu | 555-1111 |
| 1222 | Jason | Marks | jmk@uccs.edu | 555-1111 |
| 1333 | Joe | Smith | joe@uccs.edu | 555-5555 |
| 1444 | John | Smith | john@uccs.edu | 555-6666 |
| 1555 | James | Jobs | jobs@uccs.edu |
|
Professor
| PID | PFName | PLName | PRank | PEmail |
| 2111 | James | Ma | Assistant Professor | jma@uccs.edu |
| 2222 | Jack | Jobs | Dean | jack@uccs.edu |
| 2333 | Jim | Johnsons | Assistant Professor | jim@uccs.edu |
| 2444 | Jill | Johnsons | Associate Professor | jill@uccs.edu |
| 2555 | Jane | Jobs | President | jane@uccs.edu |
Course
| CCallNum | CDept | CNumber | CTitle |
| 3111 | INFS | 3000 | MIS |
| 3222 | INFS | 3000 | MIS |
| 3333 | INFS | 3080 | Programming |
| 3444 | ACCT | 1100 | Accounting Intro |
| 3555 | MGMT | 2050 | Micro Econ |
Enrollment
| EID | YYear | Semester | SID | PID | CCallNum |
| 4001 | 2013 | Spring | 1111 | 2111 | 3111 |
| 4002 | 2013 | Spring | 1111 | 2222 | 3444 |
| 4011 | 2014 | Fall | 1111 | 2111 | 3111 |
| 4014 | 2014 | Fall | 1222 | 2111 | 3111 |
| 4035 | 2014 | Fall | 1444 | 2111 | 3111 |
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
