(ER) Entity Relationship Diagram 157a (3) Flashcards
What is an entity?
An Entity may be an object with a physical existence – a particular person, car,
house, or employee – or it may be an object with a conceptual existence – a
company, a job, or a university course.
Entity Set: An Entity is an object of Entity Type and a set of all entities is called an
entity set. For Example, E1 is an entity having Entity Type Student and the set of all
students is called Entity Set. In ER diagram, Entity Type is represented as:
What is a strong entity?
A Strong Entity is a type of entity that has a key Attribute. Strong Entity does not depend on other Entity in the Schema. It has a primary key, that helps in identifying it uniquely, and it is represented by a rectangle. These are called Strong Entity
Types.
What is a weak entity?
An Entity type has a key attribute that uniquely identifies each entity in the entity set. But some entity type exists for which key attributes can’t be defined. These are called Weak Entity types.
For Example, A company may store the information of dependents (Parents, Children, Spouse) of an Employee. But the dependents don’t have existed without the employee. So Dependent will be a Weak Entity Type and Employee will be Identifying Entity type for Dependent, which means it is Strong Entity Type.
Why do we need ER diagrams?
● ER diagrams are used to represent the E-R model in a database, which makes
them easy to be converted into relations (tables).
● ER diagrams provide the purpose of real-world modeling of objects which
makes them intently useful.
● ER diagrams require no technical knowledge and no hardware support.
● These diagrams are very easy to understand and easy to create even for a
naive user.
● It gives a standard solution for visualizing the data logically.
Database Design
● What it is:
● Starting from scratch, design the database schema: relation, attributes,
keys, foreign keys, constraints etc.
● Why it’s hard:
○ The database will be in operation for years.
○ Updating the schema in production is very hard
■ schema change modifications are expensive (why?)
■ making the change without introducing any bugs is hard
● this part is, by far, the most important consideration in
practice
● Consider issues such as:
○ What entities to model
○ How entities are related
○ What constraints exist in the domain
■ Several formalisms exists
○ We discuss E/R diagrams
Database Design Process
Conceptual Model
Relational Model
Normalization(Conceptual schema)
Physical Storage(Physical schema)
What are the different components of an ER diagram?
Entity
-Strong/Weak entity
Attribute
- key attribute
- composite attribute
- multivalued attribute
- derived attribute
Relationship
- one to one
- one to many
- many to one
- many to many
What does a rectangle represent?
Entites in ER model
ER Model is used to model the logical view of the system from a data perspective
which consists of these symbols:
● Rectangles: Rectangles represent Entities in the ER Model.
● Ellipses: Ellipses represent Attributes in the ER Model.
● Diamond: Diamonds represent Relationships among Entities.
● Lines: Lines represent attributes to entities and entity sets with other
relationship types.
● Double Ellipse: Double Ellipses represent Multi-Valued Attributes.
● Double Rectangle: Double Rectangle represents a Weak Entity.
What does an ellipse represent?
Attributes in an ER model
ER Model is used to model the logical view of the system from a data perspective
which consists of these symbols:
● Rectangles: Rectangles represent Entities in the ER Model.
● Ellipses: Ellipses represent Attributes in the ER Model.
● Diamond: Diamonds represent Relationships among Entities.
● Lines: Lines represent attributes to entities and entity sets with other
relationship types.
● Double Ellipse: Double Ellipses represent Multi-Valued Attributes.
● Double Rectangle: Double Rectangle represents a Weak Entity.
What does a diamond represent?
Relationship among entites
ER Model is used to model the logical view of the system from a data perspective
which consists of these symbols:
● Rectangles: Rectangles represent Entities in the ER Model.
● Ellipses: Ellipses represent Attributes in the ER Model.
● Diamond: Diamonds represent Relationships among Entities.
● Lines: Lines represent attributes to entities and entity sets with other
relationship types.
● Double Ellipse: Double Ellipses represent Multi-Valued Attributes.
● Double Rectangle: Double Rectangle represents a Weak Entity.
What does a double ellipse represent?
Multi valued attributes
ER Model is used to model the logical view of the system from a data perspective
which consists of these symbols:
● Rectangles: Rectangles represent Entities in the ER Model.
● Ellipses: Ellipses represent Attributes in the ER Model.
● Diamond: Diamonds represent Relationships among Entities.
● Lines: Lines represent attributes to entities and entity sets with other
relationship types.
● Double Ellipse: Double Ellipses represent Multi-Valued Attributes.
● Double Rectangle: Double Rectangle represents a Weak Entity.
What does a double rectangle represent?
Weak entity
ER Model is used to model the logical view of the system from a data perspective
which consists of these symbols:
● Rectangles: Rectangles represent Entities in the ER Model.
● Ellipses: Ellipses represent Attributes in the ER Model.
● Diamond: Diamonds represent Relationships among Entities.
● Lines: Lines represent attributes to entities and entity sets with other
relationship types.
● Double Ellipse: Double Ellipses represent Multi-Valued Attributes.
● Double Rectangle: Double Rectangle represents a Weak Entity.
What are attributes?
Attributes are the properties that define the entity type. For example, Roll_No, Name, DOB, Age, Address, and Mobile_No are the attributes that define entity type Student. In ER diagram, the attribute is represented by an oval.
- Key Attribute
The attribute which uniquely identifies each entity in the entity set is called the key attribute. For example, Roll_No will be unique for each student. In ER diagram, the key attribute is represented by an oval with underlying lines. - Composite Attribute
An attribute composed of many other attributes is called a composite attribute. For example, the Address attribute of the student Entity type consists of Street, City, State, and Country. In ER diagram, the composite attribute is represented by an oval comprising of ovals. - Multivalued Attribute
An attribute consisting of more than one value for a given entity. For example, Phone_No (can be more than one for a given student). In ER diagram, a multivalued attribute is represented by a double oval. - Derived Attribute
An attribute that can be derived from other attributes of the entity type is known as a derived attribute. e.g.; Age (can be derived from DOB). In ER diagram, the derived attribute is represented by a dashed oval.
What is a relationship type?
A Relationship Type represents the association between entity types. For example,
‘Enrolled in’ is a relationship type that exists between entity type Student and Course. In ER diagram, the relationship type is represented by a diamond and connecting the entities with lines.
Relationship set?
its just multiple relationship types
A Relationship Type represents the association between entity types.