In this assignment you will create the physical database from your design 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.

computer science

Description

CMI3020 Project 3

In this assignment you will create the physical database from your design 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 each of the steps below you may create a separate SQL script files. 

Assignment Details:

1) Create database tables using SQL Data Definition Language (DDL) for each table listed in the metadata of Project 2. 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. You should rerun and test your SQL script file until it runs without any errors (this is why you’ll want to include DROP TABLE statements in another script). 

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. You should test and rerun your SQL script file until it runs without any errors.

3) Use (Oracle's) SQL Developer or another database program to create and test the SQL file. You will find an Oracle database and Oracle's SQL Developer in the virtual Lab Broker. There are several class announcements that provide alternatives to the Virtual Lab for those having difficulty in accessing the VM.

You should test your SQL script file until it runs without any errors. 

Retrieve all of your customers' names, account numbers, and addresses (street and zip code only), sorted by account number.

Retrieve all of the videos rented in the last 30 days and sort in chronological rental date order.

Produce a list of your distributors and all their information sorted in order by company name.

Update a customer name 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 ROLLBACK statement to undo your data update.

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 statement to undo your data deletion. 

Submit

You may have completed this assignment by creating multiple smaller scripts instead of a single large script.  Submit all of the scripts and name them in such a way that it shows the order that the scripts should be run in. Name each file with your last name, followed by the ordering.  For example Smith_Part_A.sql.  Also include the script that un-does or drops work done in the prior script.  Name it accordingly.  For example Smith_Part_A_Drop.sql.  

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 errors; 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 errors. 0 points

Many SQL statements fail due to syntax errors and/or integrity constraint violations or SQL is missing

SELECT SQL statements 20 points

All SQL statements are syntactically correct and execute without errors. 0 points

Many SQL statements fail due to syntax errors or SQL is missing

UPDATE and DELETE SQL statements 10 points

Statements execute without errors based on primary key column in WHERE clause 0 points 

Statements fail due to syntax or other errors

SQL script file 15 points 

Demonstrates full ability to create and use an Oracle SQL script filed 0 points

Many errors setting up and using an SQL script file or no attempt made at all


Instruction Files

Related Questions in computer science category