









Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!










Entity Relationship Model (ER Modeling) is a graphical approach to database design. It is a high-level data model that defines data elements and their relationship for a specified software system. An ER model is used to represent real- world objects. An Entity is a thing or object in real world that is distinguishable from surrounding environment. For example, each employee of an organization is a separate entity. Following are some of major characteristics of entities. ļ· An entity has a set of properties. ļ· Entity properties can have values. In this tutorial, you will learn- ļ· Enhanced Entity Relationship (EER) Model ļ· Why use ER Model? ļ· Entities in the āMyFlixā library ļ· Defining the Relationships Among Entities Letās consider our first example again. An employee of an organization is an entity. If āPeterā is a programmer (an employee ) at Microsoft, he can have attributes ( properties) like name, age, weight, height, etc. It is obvious that those do hold values relevant to him. Each attribute can have Values. In most cases single attribute have one value. But it is possible for attributes have multiple values also. For example Peterās age has a single value. But his āphone numbersā property can have multiple values. Entities can have relationships with each other. Letās consider the simplest example. Assume that each Microsoft Programmer is given a Computer. It is clear that that Peterās Computer is also an entity. Peter is using that computer, and the same computer is used by Peter. In other words, there is a mutual relationship between Peter and his computer. In Entity Relationship Modeling, we model entities, their attributes and relationships among entities.
Enhanced Entity Relationship (EER) Model is a high-level data model which provides extensions to original Entity Relationship (ER) model. EER Models supports more details design. EER Modeling emerged as a solution for modeling highly complex databases. EER uses UML notation. UML is the acronym for Unified Modeling Language; it is a general-purpose modeling language used when designing object-oriented systems. Entities are represented as class diagrams. Relationships are represented as associations between entities. The diagram shown below illustrates an ER diagram using the UML notation.
Now you may think why use ER modeling when we can simply create the database and all of its objects without ER modeling? One of the challenges faced when designing a database is the fact that designers, developers, and end-users tend to view data and its usage differently. If this situation is left unchecked, we can end up producing a database system that does not meet the requirements of the users. Communication tools understood by all stakeholders(technical as well as non-technical users) are critical in producing database systems that meet the requirements of the users. ER models are examples of such tools. ER diagrams also increase user productivity as they can be easily translated into relational tables. Case Study: ER diagram for āMyFlixā Video Library
From the above scenario, we can see that the nature of the relationship is many-to-many. Relational databases do not support many-to-many relationships. We need to introduce a junction entity. This is the role that the MovieRentals entity plays. It has a one-to-many relationship with the members table and another one-to-many relationship with movies table. Movies and categories entities The following holds true about movies and categories. ļ· A movie can only belong to one category but a category can have more than one movie. We can deduce from this that the nature of the relation between categories and movies table is one-to- many. Members and payments entities The following holds true about members and payments ļ· A member can only have one account but can make a number of payments. We can deduce from this that the nature of the relationship between members and payments entities is one-to-many. Now lets create EER model using MySQL Workbench In the MySQL workbench , Click ā ā+ā Button
Double click on Add Diagram button to open the workspace for ER diagrams.
Following window appears
Next ,
Repeat the above steps for all the identified entities. Your diagram workspace should now look like the one shown below.
Repeat above steps for other relationships. Your ER diagram should now look like this ā
ļ· The full form of ER is Entity and Relationships Diagrams. They play a very important role in the database designing process. They serve as a non-technical communication tool for technical and non-technical people. ļ· Entities represent real world things; they can be conceptual as a sales order or physical such as a customer. ļ· All entities must be given unique names. ļ· ER models also allow the database designers to identify and define the relations that exist among entities.