Project 3

CMIS 320 Project 3 In this assignment you will perform the physical design and implementation using SQL Data Definition Language (DDL) and proceed with populating the Mom and Pop Johnson Video Store database via Data Manipulation Language (DML) SQL commands. For e ach of the steps be low you may create a separate SQL script file and SPOOL file or you may want to put the SPOOL output for several steps, from the same SQL script file, in the same file . Be sure your SPOOL f ile(s) contains your SQL statements along with the Oracle response s and/or displayed results. Do NOT submit your SQL script files. Only submit your output SPOOL files. Assignment Details: 1) Create Oracle database tables using SQL Data Definition Language (DDL) for each table listed in the metadata of Assignment 1. You may need to use a combination of DROP TABLE, CREATE TABLE, and ALTER TABLE SQL statements. Make sure that entity and referential integrity are enforced by declaring a primary key for each table (these may be composite keys) and declaring all appropriate foreign keys. Your CREATE TABLE and ALTER TABLE statements (if desired) must show integrity constraints, as appropriate, for NOT NULL, UNIQUE, PRIMARY KEY, FOREIGN KEY, REFERENCES, and CHECK constraints. Be sure to save your SQL script file used to create these tables with a .sql extension and your output SPOOL file with a .lst or .txt extension. You should rerun and test your SQL script file until it runs without any error s (this is why you’ll want to include DROP TABLE statements) . Submit your SPOOL fil e showing that all SQL in your SQL script file worked properly. 2) Populate each of your tables with at least five valid rows of data each and show the SQL INSERT statements as you executed them . Populate other tables in your database, as necessary, to satisfy referential integrity. Save your SQL script file and SPOOL file with the correct extensions. You should test and rerun your SQL script file until it runs without any error. Submit your SPOOL file showing that all SQL in your SQL script file worked properly. 3) Develop an SQL script file to perform the following queries and updates. You should test your SQL script file until it runs without any errors. o Retrieve all of your customers' names, account numbers, and addresses (street and zip code only), sorted by account number. o Retrieve all of the videos rented in the last 30 days and sort in chronological rental date order. o Produce a list of your distributors and all their information sorted in order by company name. o Update a customer n ame to change their maiden name to a married name . You can choose which row to update. Make sure that you use the primary key column in your WHERE clause to affect only a specific row. You may want to include a R OLLBACK statement to undo your data update. o Delete a customer from the database. You can choose which row to delete. Make sure that you use the primary key column in your WHERE clause to affect only a specific row. You may want to include a ROLLBACK state ment to undo your data deletion. Submit your SPOOL file(s) showing that all SQL in your SQL script file worked properly. Show the actual SQL statements executed and the results the SQL produced below the code by making sure that you have a SET ECHO STATEM ENT in your SQL script file(s). Do NOT submit your .sql SQL script files. Grading rubric Attribute Meets Does Not Meet Expectations CREATE TABLE and ALTER TABLE SQL statements 30 points All SQL statements are syntactically correct and execute without error; all integrity constraints are properly declared; 0 points Many SQL statements fail due to syntax errors or SQL is missing INSERT SQL statements 25 points All SQL statements are syntactically correct and execute without error 0 points Many SQL statements fail due to syntax errors and/or integrity constraint viola tions or SQL is missing SELECT SQL statements 20 points All SQL statements are syntactically correct and execute without error 0 points Many SQL statements fail due to syntax errors or SQL is missing UPDATE and DELETE SQL statements 10 points Statements execute without error based on primary key column in WHERE clause 0 points Statements fail due to syntax or other errors SQL script file and SPOOL file 15 points Demonstrates full ability to create and use an Oracle SQL script file and output SPOOL file 0 points Many errors setting up and using an SQL script file with SPOOL file or no attempt made at all