Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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 each of the steps below 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 file(s) contains your SQL statements along with the Oracle responses 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 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 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 errors (this is why youll want to include DROP TABLE statements). Submit your SPOOL file 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 errors. 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 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. 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 statement 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 STATEMENT in your SQL script file(s).

My previous assignment:

image text in transcribed

Entities with corresponding attributes:

Customers: Customer ID, First Name, Middle in, Last Name, Street Address, City, State, Zip, Phone #.

Transactions: Trans ID, Customer ID, Rental Date, Return Due Date, Price, Tax, Fees, Total.

DVDs: DVD ID, Movie ID.

Videos: Video ID, Movie ID.

Movies: Movie ID, Title, Genre, Run Time, Year, Rating.

Awards: Award ID, Award Name.

Directors: Director ID, First Name, Last Name.

Performers: Performer ID, First Name, Last Name.

Distributor Video: Dist Video ID, Dist Movie ID.

Catalog: Dist Catalog ID, Title, Genre, Run Time, Year, Rating.

Distributor DVD: DIst DVD ID, Dist Movie ID.

Distributor, Distributor ID, Distributor Name.

To avoid many to many relationships several bridge entities were necessary.

DVD Transactions: DVD Trans ID, Trans ID, Movie ID, DVD ID, Date Rented, Date Returned, Late Fee, Damage fee, Rental Price, Trans Total.

Video Transactions: Video Trans ID, Trans ID, Movie ID, DVD ID, Date Rented, Date Returned, Late Fee, Rewind Fee, Damage fee, Rental Price, Trans Total.

Director Info: Director Info ID, Director ID, Movie ID.

Award Info: Award Info ID, Award ID, Movie ID, Director ID. Performer ID.

Performer Info: Performer Info ID, Actor/Actress ID, Movie ID

Distributor Info: Dist Info ID, Dist Movie ID, Dist DVD ID, Dist Video ID.

Customers Transactions rans I Customer ID Rental Date Return Due Date Price Tax Fees ota Video Transactions Customer ID First Name Middle in Last Name Street Address City State Zip Phone # Movies Movie ID Title Genre Run Time Year Rating DVD Transactions DVD Trans ID Trans ID Movie ID DVD ID Date Rented Date Returned Late Fee Video Trans ID Trans ID Movie ID Video ID Date rented Date Returned Late Fee Rewind fee Damage fee Rental Price Trans Total Damage Director Info Director Info ID Director ID Movie ID DVDs DVD ID Movie ID Rental Price Trans Total Videos Video ID Movie ID Awards Performers Award ID Award Name Directors Director ID First Name Last Name Performer ID First Name Last Name Performers Info Distributor Info Performer Info ID Actor/Actress ID Movie ID Award Info Award Info ID Award ID Movie ID Director ID Performer ID Dist Info ID Dist Movie ID Dist DVD ID Dist Video ID Catalog Dist Catalog ID Title Genre Rating Year Runtime Distributor DVD Dist DVD ID Dist Movie ID Distributor Video Distributor Dist Video ID Dist Movie ID Distributor ID Distributor Name

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Practical Database Programming With Visual C# .NET

Authors: Ying Bai

1st Edition

0470467274, 978-0470467275

More Books

Students also viewed these Databases questions

Question

Describe key customer feedback collection tools.

Answered: 1 week ago

Question

Know what customers expect from the firm when they complain.

Answered: 1 week ago

Question

Understand why customers complain.

Answered: 1 week ago