Video Database, mysql assignment help

User Generated

Henohf1

Programming

Description

You are a database consultant with Ace Software, Inc., and have been assigned to develop a database for the Mom and Pop Johnson video store in town. Mom and Pop have been keeping their records of videos and DVDs purchased from distributors and rented to customers in stacks of invoices and piles of rental forms for years. They have finally decided to automate their record keeping with a relational database.

You sit down with Mom and Pop to discuss their business, and watch their operation for about a week. You discover quickly that a video and a DVD are both copies of a movie kept in a separate plastic case that is rented out. They have several copies of each movie they rent, therefore there are several videos and DVDs for each movie title. You learn that in their inventory they have several thousand videos and DVDs, which they get wholesale from about a half dozen distributors. The video and DVD prices to them are based on the quantity of their shipment and the past business they have done with each company.

The price of a DVD for a movie might be different than the price of a video for the same movie, even from the same distributor. Each distributor provides different types of movies (e.g., suspense, horror, mystery, comedy, etc.). A single distributor may provide several different types of movies in both video and DVD format. It is possible to obtain the same movie from multiple distributors and at different wholesale prices.

Each video and DVD has a unique identification number that Mom and Pop assign in their inventory, in addition to the distributor's serial number for the item. Each movie also has a unique identification number Mom and Pop assign in addition to the title and any movie IDs the distributors use in their electronic catalogs. Distributors provide electronic catalogs to Mom and Pop, and the information from these catalogs must be included in the database.

Mom and Pop need to record when a video or DVD is rented, when a video or DVD is returned, and all customer charges such as late and damaged fees, failure to rewind fees, and taxes. They need a report of which videos are returned late because there are standard and late charges. On occasion there are discount prices for certain movies or types of movies. Customers want to rent movies based on actors or actresses, running length, type of movie, rating, year released, the director, and the Academy Awards won (by the movie, the actors, the actresses and/or the directors). Customers also want to know how many videos they have rented in the last month, year, and so forth. Mom and Pop need to keep only basic information on customers in their database, such as name, address, telephone numbers, etc.

There must be no limit to the number of video and/or DVD copies of a movie that Mom and Pop can have in their inventory. Video/DVD ID numbers, movie ID numbers, and distributor ID numbers for videos, DVDs, and movies are all different. Also, each movie must be able to have an unlimited number of actors, actresses, directors, and Academy Awards (i.e., Oscars). Other types of awards (e.g., Golden Globe, People's Choice, etc.) are not of interest for this application. The rental of equipment, sale of videos, DVDs, popcorn, etc., is not to be kept in the database.

  1. Identify and describe the entities and their attributes.
  2. Develop relationship sentence pairs.
  3. Draw an ERD using any graphics tool of your choice. (Viso, PowerPoint, Lucidchart, etc.)
  4. Develop metadata from the ERD and document in an Excel spreadsheet.
  5. Using your selected RDBMS (SQL Server, Oracle, or MySQL), develop and execute an SQL script file of DDL SQL to create the database tables in the metadata document.
  6. Using your selected RDBMS, develop and execute an SQL script file of DML SQL INSERT statements to populate the tables using SQL INSERT statements for at least 5 rows of data per table.
  7. Using your selected RDBMS develop and execute an SQL script file to:
    1. Show the contents of each of your tables, one at a time
    2. Retrieve all of the customers' names, account numbers, and addresses (street and zip code only), sorted by account number
    3. Retrieve all of the DVDs rented in the last 30 days and sort in chronological rental date order
    4. Update a customer name to change their maiden names to married names. 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.
    5. Delete a specific 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.

The metadata should be submitted in an Excel spreadsheet. All other outputs for the database design, SQL code, and SQL results should be submitted in a single Word file in order, by step, and clearly labeled.

The Word file should also have a preface describing the database life cycle steps and methodologies and a conclusion section containing lessons learned from the course. The paper should be well written and formatted in conformity with CSU-Global Guide to Writing and APA Requirements.

User generated content is uploaded by users for the purposes of learning and should be used following Studypool's honor code & terms of service.

Explanation & Answer

This is the work. Please check it out, everything is working as supposed.

Using your selected RDBMS (SQL Server, Oracle, or MySQL), develop and execute an SQL script
file of DDL SQL to create the database tables in the metadata document.

Create MOM and Pop Database:
CREATE DATABASE mom_and_pop

Create User Customers table

CREATE TABLE IF NOT EXISTS users_customers(
customer_id INT(11) NOT NULL AUTO_INCREMENT,
first_name VARCHAR(50) NOT NULL,
last_name VARCHAR(50) NOT NULL,
email_address VARCHAR(255) NOT NULL,
address VARCHAR(255) NOT NULL,
telephone_number int(12) NOT NULL,
PRIMARY KEY (customer_id),
UNIQUE KEY email_address (email_address)
)

Create Distributor’s Table
CREATE TABLE IF NOT EXISTS distributors_table(
distributor_id INT(11) NOT NULL AUTO_INCREMENT,
distributor_name VARCHAR(50) NOT NULL,
address VARCHAR(255) NOT NULL,
telephone_number int(12) NOT NULL,
PRIMARY KEY (distributor_id)
)

Create Movie Characters
CREATE TABLE IF NOT EXISTS movie_character_table(
character_id INT(11) NOT NULL AUTO_INCREMENT,
character_fname VARCHAR(50) NOT NULL,
character_lname VARCHAR(50) NOT NULL,
character_role ENUM('director','actor','actress') NOT NULL,
PRIMARY KEY (character_id)
)

Create Movie table
CREATE TABLE IF NOT EXISTS movie_table(
movie_id INT(11) NOT NULL AUTO_INCREMENT,
movie_name VARCHAR(50) NOT NULL,
movie_genre ENUM
('suspense','horror','mystery','comedy','animation','action')
NOT NULL,
movie_duration INT(3) NOT NULL,
movie_rating INT(1) NOT NULL,
release_year YEAR NOT NULL,
PRIMARY KEY (movie_id)
)

Create distribution table
CREATE TABLE IF NOT EXISTS movie_distribution_table(
distribution_sn INT(11) NOT NULL AUTO_INCREMENT,
distributor_id int(11) NOT NULL,
movie_id int(11) NOT NULL,
movie_format ENUM('DVD','video') NOT NULL,
quantity int(11) NOT NULL,
price int(11) NOT NULL,
CONSTRAINT movie_table_cnt
FOREIGN KEY(movie_id)
REFERENCES movie_table(movie_id) ON UPDATE CASCADE,
CONSTRAINT distributor_table_cnt
FOREIGN KEY(distributor_id)
REFERENCES distributors_table(distributor_id) ON UPDATE CASCADE,
PRIMARY KEY (distribution_sn)
)

Create Movie Actor Relation table

CREATE TABLE IF NOT EXISTS movie_actor_relation_table(
movie_actor_id INT(11) NOT NULL AUTO_INCREMENT,
character_id int(11) NOT NULL,
movie_id int(11) NOT NULL,
CONSTRAINT movie_table_cnt
FOREIGN KEY(movie_id)
REFERENCES movie_table(movie_id) ON UPDATE CASCAD...


Anonymous
Just the thing I needed, saved me a lot of time.

Studypool
4.7
Trustpilot
4.5
Sitejabber
4.4

Related Tags