Project 1 ERD and Its Description

Total Page:16

File Type:pdf, Size:1020Kb

Project 1 ERD and Its Description

Project 1 ERD and its description

Entities and relationship diagram and description of Mom and Pop Johnson Video Store database

This is the design that you can use to complete your project 2 based on the description and requirement in project 2 description. However, you are allowed to make any modification you feel that they are proper or could enhance the functionality of the database or simply you found the design had fraud. No matter how do you change the design the final implementation should be functionally correct and theoretically makes sense. For example, no M:N issue reoccurs.

Secondly this design does not include physical mapping, meaning attributes need to be mapped to columns with proper datatype. Certain non-key attributes may be required check constraint for its value validation, such as type_distributed in movie_list.

Business analysis of the project:

1. Generally, movies are released to public regardless vendor distribution is available or not. Therefore, movies entity should list all the movies available to general public.

2. Distributors (vendors) have their own inventory lists to list movies they are selling to their buyers, such as Mom & Pop Video Store. Such inventory entity is a subset of movies listed in movies entity. It should list all the movies distributors sell with proper type (DVD or Video or both) associated with each distributed movie.

3. Mom & Pop Video Store buy their movies from the vendors by placing orders containing the selection from inventory list. Each order may contain more than one items. The movies purchased should be entered in the renting list (see next).

4. Mom & Pop Video Store has its own list of movies for their renting business with price per rent. This list is a subset of the inventory distributors sell. This renting list serves as a selection list for the store customers to rent their selected movie(s). Since most likely there are more than one copies for each individual renting title in the store, there should be additional entity (title_copies) to list every copy of the individual movies. In fact, this title_copies should be used for renting transactions because customers take one copy of each movie they rent. Customers and title_copies entities have Many to many relationship to be resolved. The associative entity could be used to record renting transactions as well.

5. Customers are the people who rent movies from Mom & Pop Video Store. They should have an account in the store and their renting records should be collected.

1 Project 1 ERD and its description

6. Actors and Movie Awards are independent entities. Each actor may act in more than one movies and each movie may have more than one actor. Awards have the similar situation as Actors. These many to many relationship need to be resolved by introducing associated entity.

2 Project 1 ERD and its description

Table 1. Entities and relationship of Mom and Pop Johnson Video Store.

Entities Attributes Keys Explanation Movies Movie_id Movie_id is primary This entity is used to store movie data related to movie itself, Title key . such as title or content description. discription 1. Actors played in movie cannot store here because movie and actors are M:N relationship. Need additional associative entity (actor_in_movies) to establish two 1:N relationships to deal with the case. Movies to actor_in_movies Actors to actor_in_movies 2. Awards and movies have the same relationship (M:N) as above. Movie_awarded working the same way as actor_in_movie.

Movie_awarded Winning_id Winning_id is Movie_id and Award_id are foreign key to reference to the Movie_id primary key attributes in corresponding parent entities. Award_id

Awards Award_id Award_id is primary Description key Awarded_date Actor_in_movie Actor_in_movie__id Actor_in_movie__id Actor_id and Movie_id are foreign key to reference to the s Actor_id Is primary key attributes in corresponding parent entities. Movie_id Actors Actor_id Actor_id is primary Firstname key Lastname Gender contact Distribution_list List_id List_id is primary Movie_list stores data for every movie available on the market Movie_id key (must be in movies entity ) based their released type (DVD or

3 Project 1 ERD and its description

Distributor_id Vedio). Type_distributed Note: you should The movies in any types are distributed by a distributor listed in Inventory_quantity consider use check distributors. constriant on Quantity of each available type of movies are stored based on Type_distributed type and distributors. To limit values as DVD or VEDIO. Movie_id is a foreign key that references movies.

Distributors Distributor_id Distributor_id is Distributor data is stored in this entity Description primary key Location contact Orders Order_id Order_id is primary Any orders for DVD or VEDIO should be stored here and each Description key record is uniquely identified by order_id. Total_items Total_payment Tax Order_status Date_ordering Order_completed_date Order_completed_by Order_items Item_id Item_id is primary Item_id identifies each item in a particular order. Any item Order_id key ordered should be in an order. Any items ordered must be List_id available in distribution_list. copy_number unit_price Order items are listed in order_items entity that must references item_total_price order_id in orders and also it should reference distribution_list

Multiple copies of the same item should be only in one record.

Order_id is a foreign key that references orders entity. List_id is a foreign key that references distribution_list.

4 Project 1 ERD and its description customers Customer_id Customer_id is Firstname primary key Lastname Address Card_approval Rent_limit Overdue_notified Renting_titles Title_id Title_id is primary The movies should be available (listed in movies) Movie_id key In_store Movie_id is foreign key references to movies Available_for_rent Rent_price The movies should be also in store, meaning purchased. This is Type_distributed better controlled at application level. Not in database level so we do not add any additional relationship to other related entity, such as order_items

Title_copies Copy_id Copy_id is primary Each renting title may have one or more copies. This entity is a Title_id key child of renting_titles to record each copy of the given title of Available renting movie.

Title_id is foreign key that references renting_titles.

Movie availability should be always checked.

Movie_renting Rent_record_id Rent_record_id is customers and title_copies have M:N relationship. Therefore, Copy_id primary key movie_renting is used to resolve the issue to create two 1:N Customer_id relationships, respectively. Rented_date Returned_date Copy_id and customer_id are the foreign keys to title_copies Overdue and customers, respectively.

5 Project 1 ERD and its description

Rent_fee Overdue_fee

6 Project 1 ERD and its description

Figure 1 ERD – Mom and Pop Johnson Video Store database. The ERD was made using CA Erwin. The drawing notations are slightly different from what is described in the textbook. Below is a note to explain how to read it.

Outside of the boxes are entity names, ids are primary key shown in upper box or foreign keys, doted and solid lines indicate the relationship (1:N). Black dot side indicates N. Any attributes with FK indicate they are foreign keys.

7 Project 1 ERD and its description

This figure is to further show the entity groups that store the data based on business processes. The chart is identical to the one above.

8

Recommended publications