CS 275 Final Project (50pts Total) Solve the following problems and save your queries and scripts in APEX and in a Word file. Name your saved file in APEX CS275FinalProj. Save your word file as follows: yourlastnamecs275finalproj and drop your file into the shared Google Drive folder. 1. Write a script to produce the following tables (3 points each): (remember to carefully choose your data types!) a. STUDENT b. FACULTY c. CRSSECTION
d. REGISTRATION e. DEPARTMENT 2. Reverse engineer an Entity Relationship Diagram from the tables above. (5pts) Note: Keep in mind the way foreign keys are decided from an ERD for a table implementation! Note: You may choose any non-transferrable, barred, or exclusive relationships you want as long as they include a brief
description as to why it is needed or wanted. 3. Write the query to produce a list of all the students that includes their first name, last name, and phone number list in alphabetical order by last name. (2pts) 4. Write a query that shows the average capacity for all courses and the actual average enrollment for all courses during winter and spring term. (2pts) 5. The CRSSECTION table contains a data entry error for CSID 1210, COURSEID CIS253 UPDATE the MAXCOUNT to 30 and the ACTUALCOUNT to 22 for the course. (2pts) 6. Write a query that lists all the students by first name, last name and their faculty advisor s name label the column Advisor and the advisor phone number label the column Ext. List the output by the Advisor s name in alphabetical order. Use an ANSI standard join. (3pts) 7. For the following queries you choose the order in which to execute the following instructions: a) Implement the foreign key constraint in the FACULTY table that references the Department table - ensure you name the constraint (3pts) b) Create a COURSE table with the following attributes: CourseID, Title, and Credits. The precision of CourseID should be six (6). The Title should be allowed to have a length of 20. The Credits should be allowed to have a length of 2. The CourrseID is the primary key and should be implemented at table level ensure you name the constraint. (5pts) c) Insert the following data into the department table using an explicit insert for the first 3 rows and an implicit insert for last 3 rows. (4pts) CourseID Title Credits EN100 Basic English 0 LA123 English Literature 3 CIS253 Database Systems 3 CIS265 Systems Analysis 3 MA150 College Algebra 3 AC101 Accounting 3 8. List the Faculty Department Chair for each Department, the department name and the department chair extension - include those departments that do not have a department head assigned. Use the Oracle proprietary join syntax. (3pts) 9. Create a view that displays all of the students by first name, last name, state, and major id. List by state and ensure the user can not make any changes to the student base table. (2pts) 10. Create a view that lists the CSID, COURSEID, SECTION, and TERMID for the CIS253 course. Ensure that your view will allow only DML transactions for CIS253. (4pts)
You should be able to (with minimal effort), be able to use the following script to iinsert data into your tables once they have been created: INSERT INTO course VALUES ('EN100', 'Basic English', 0); INSERT INTO course VALUES ('LA123', 'English Literature', 3); INSERT INTO course VALUES ('CIS253', 'Database Systems', 3); INSERT INTO course VALUES ('CIS265', 'Systems Analysis', 3); INSERT INTO course VALUES ('MA150', 'College Algebra', 3); INSERT INTO course VALUES ('AC101', 'Accounting', 3); INSERT INTO faculty VALUES (111, 'Jones', 11, 525, 1); INSERT INTO faculty VALUES (222, 'Williams', 20, 533, 2); INSERT INTO faculty VALUES (123, 'Mobley', 11, 529, 1); INSERT INTO faculty VALUES (235, 'Vajpayee', 12, 577, 2); INSERT INTO faculty VALUES (345, 'Sen', 12, 579, 3); INSERT INTO faculty VALUES (444, 'Rivera', 21, 544, 4); INSERT INTO faculty VALUES (555, 'Chang', 17, 587, 5); INSERT INTO faculty VALUES (333, 'Collins', 17, 599, 3); INSERT INTO student VALUES ('00100', 'Diaz', ' Jose', '1 Ford Avenue #7', 'Hill', 'NJ', '08863', 'WN00', TO_DATE ('02/12/1980', 'mm/dd/yyyy'), 123, 100, '9735551111'); INSERT INTO student VALUES ('00101', 'Tyler', ' Mickey', '12 Morris Avenue', 'Bronx', 'NY', '10468', 'SP00', TO_DATE ('03/18/1975', 'mm/dd/yyyy'), 555, 500, '7185552222'); INSERT INTO student VALUES ('00102', 'Patel', ' Rajesh', '25 River Road #3', 'Edison', 'NJ', '08837', 'WN00', TO_DATE ('12/12/1982', 'mm/dd/yyyy'), 111, 400, '7325553333'); INSERT INTO student VALUES ('00103', 'Rickles', ' Deborah', '100 Main Street', 'Iselin', 'NJ', '08838', 'FL00', TO_DATE ('10/20/1970', 'mm/dd/yyyy'), 555, 500, '7325554444'); INSERT INTO student VALUES ('00104', 'Lee', ' Brian', '2845 First Lane', 'Hope', 'NY', '11373', 'WN00', TO_DATE ('11/28/1975', 'mm/dd/yyyy'), 345, 600, '2125555555'); INSERT INTO student VALUES ('00105', 'Khan', ' Amir', '213 Broadway', 'Clifton', 'NJ', '07222', 'WN00', TO_DATE ('07/07/1981', 'mm/dd/yyyy'), 222, 200, '2015556666'); INSERT INTO crssection VALUES (1101, 'CIS265', '01', 'WN01', 111, 'MW', '09:00', '10:30', 13, 30, 21); INSERT INTO crssection VALUES (1102, 'CIS253', '01', 'WN01', 123, 'TR', '09:00', '10:30', 18, 40, 39); INSERT INTO crssection VALUES (1103, 'MA150', '02', 'WN01', 444, 'F', '09:00', '12:00', 15, 25, 25); INSERT INTO crssection VALUES (1104, 'AC101', '10', 'WN01', 345, 'MW', '10:30', '12:00', 16, 35, 35); INSERT INTO crssection VALUES (1205, 'CIS265', '01', 'SP01', NULL, 'MW', '09:00', '10:30', 14, 35, 12); INSERT INTO crssection VALUES (1206, 'CIS265', '02', 'SP01', 111, 'TR', '09:00', '10:30', 18, 30, 27); INSERT INTO crssection VALUES (1207, 'LA123', '05', 'SP01', NULL, 'MW', '09:00', '10:30', 15, 30, 29); INSERT INTO crssection VALUES (1208, 'CIS253', '21', 'SP01', 123, 'TR', '09:00', '10:30', 14, 40, 40); INSERT INTO crssection VALUES (1209, 'CIS253', '11', 'SP01', 111, 'MW', '09:00', '10:30', 18, 40, 5); INSERT INTO crssection VALUES (1210, 'CIS253', '31', 'SP01', 123, 'F', 'TBA', 'TBA', 11, 1, 1);
INSERT INTO registration VALUES ('00100', 1101, 'C', 'F'); INSERT INTO registration VALUES ('00100', 1102, 'B', 'B'); INSERT INTO registration VALUES ('00100', 1104, 'B', 'A'); INSERT INTO registration VALUES ('00101', 1102, 'F', 'D'); INSERT INTO registration VALUES ('00101', 1103, 'A', 'A'); INSERT INTO registration VALUES ('00103', 1101, 'F', 'W'); INSERT INTO registration VALUES ('00103', 1104, 'D', 'D'); INSERT INTO registration VALUES ('00100', 1207, '', ''); INSERT INTO registration VALUES ('00103', 1206, '', ''); INSERT INTO registration VALUES ('00104', 1206, '', ''); INSERT INTO registration VALUES ('00104', 1207, '', ''); INSERT INTO registration VALUES ('00104', 1210, '', ''); INSERT INTO registration VALUES ('00105', 1208, '', ''); INSERT INTO registration VALUES ('00105', 1209, '', ''); INSERT INTO registration VALUES ('00101', 1205, '', ''); INSERT INTO registration VALUES ('00102', 1210, '', ''); INSERT INTO registration VALUES ('00102', 1207, '', ''); INSERT INTO registration VALUES ('00102', 1206, '', '');