$25
In this lab, you will demonstrate you are comfortable navigating the AWS Oracle RDS environment and creating basic Schema objects using SQL developer or similar tool. This lab is a review of basic SQL.
Lab Requirements
1. Write and test a set of SQL statements that will drop the following tables:
a. Engineers
b. Faculty
c. Classes
d. ClassEnrollments
Be sure to use the exact table names as listed.
Note: Since you probably have not yet created there tables, you will receive an error which is Okay and expected.
2. Write and test a set of SQL statements that will create the following tables:
a. Engineers
Primary Key: EID
Columns: Lastname, Firstname, Email, Graddate
b. Faculty
Primary Key: FID
Columns: Lastname, Firstname, Email, Hiredate
c. Classes
Primary Key: CID
Columns: Subject (e.g. SDEV), Catalognbr (e.g. 350), Title (e.g Database Security ) d. ClassEnrollments
Primary Key: EnID
Foreign Keys: CID (from Classes), FID (from Faculty), EID (from Engineers)
Be sure table and column names exactly match the requirements.
3. Write and test a set of SQL statements that will insert the following quantity of records into each table
a. 15 Engineers
b. 3 Faculty
c. 3 Classes
d. 15 ClassEnrollments
Your Primary Key IDs should always start with 1 and increment by 1. You can use an Oracle sequence but it is not required. Just hardcoding the Primary Key ID is Okay for this exercise.
4. Write and test a set of SQL statements that will select all records from each table. The output should display the records in descending order by Primary key.
5. Write and test a set of SQL statements that will Update records with the following specifications
a. Update the Lastname of one faculty in the Faculty table to be “Friendship”.
b. Update the Firstname of one engineer in the Engineers table to be “Amadeus”.
c. Update the Subject of one class in the Classes table to be “IOT Cyber”.
You may need to use these requirements as you design your insert statements for step 3.
6. Write and test a SQL statement that will Delete the ClassEnrollments record with the lowest EnID
Write and test a SQL statement that creates a view joining the required tables such that a user can retrieve the Engineer’s Lastname and Firstname, the Faculty Lastname and Email and the Classes’s Subject and Title for each Course enrollment