140 likes | 285 Views
Entity Relationship Modelling. What is Entity Relationship Modelling?. The Entity-Relationship model is – “ a data model for high-level descriptions of conceptual data models, and it provides a graphical notation for representing such data models in the form of entity-relationship diagrams. ”
E N D
What is Entity Relationship Modelling? The Entity-Relationship model is – “a data model for high-level descriptions of conceptual data models, and it provides a graphical notation for representing such data models in the form of entity-relationship diagrams.” [Wikipedia Website]
What does this mean? Basically a entity-relationship model is – • A simple way to representing on paper, an idea for a data model e.g. a database. • With special graphical systems and symbols.
Key Terms • Entity • Relationship • Attribute • Primary Key
What is an Entity? • An entity represents a discrete object. • Entities are generally nouns. Examples include – • a computer, an employee, a song.
Relationships • A relationship captures how two or more entities are related to one another. • Relationships can be thought of (roughly) as verbs. Examples include – • an owns relation between a company and a computer. • a supervises relation between an employee and a department • a performs relation between an artist and a song
Attributes Entities and relationships can both have attributes. Examples – • an employee entity might have a national insurance number attribute. • the proved relation may have a date attribute.
Primary Keys • A primary key is an attribute which can uniquely identify an Entity. Example – A National Insurance number, as each person has a different number to everyone else.
Entity Relationship Diagrams (ERDs) Important - • Entity-relationship diagrams don't show single entities or single instances of relations. • they show entity sets and relationship sets. Example – • a particular song is an entity. • The collection of all songs in a database is an entity set.
Common Notation There are many systems of notation for ERDs. These are the common symbols used - • Entity Sets - drawn as rectangles. • Relationships - drawn as diamonds. • Attributes - drawn as ovals connected to their owning entity sets by a line.
Less Common Notion Weak Entities • Cannot be identified by their attributes alone • Therefore must use as its primary key its own attributes and the primary key of an entity it is related to.
Example Models Simple Model –
Example Models (Cont.) More advanced model –
Further Reading • Wikipedia Website – http://en.wikipedia.org/wiki/Entity_relationship_diagram • Peter Pin-Shan Chen - “The Entity-Relationship Model-Toward a Unified View of Data” http://bit.csc.lsu.edu/~chen/pdf/erd.pdf