- Entity Types, Entity Sets, Keys, and Value Sets :-
- Entity Types and Entity Sets :-
- An entity type describes the schema or intension for a set of entities that share the same attributes.
- The collection of entities of a particular entity type is grouped into an entity sey which is also called the extension of the entity type.
Figure 2.6 shows two entity types: EMPLOYEE and COMPANY and a list of some of the atributes for each. A few individual entities of each type are also illustrated, along with the values of their attributes.
The collection of all entities of a particular entity type in the database at any point in time is called an Entity set; the entity set is usually referred to using the same name as the entity type. For example, EMPLOYEE refers to both a type of entity as well as the current set of all employee entities in the database.
- Key Attributes of an Entity Type :-
- Value Sets of Attributes :-
- Relationship :-
Example: A Student Enrolls in a Course. Here, "Student" and "Course" are two ditferent entities and the relationship between them is "Enrolls".
The degree of a relationship is the number of entities associated with a relationship. The degree of a relationship is also called "Cardinality".
- Relationship Classiflcation :-
One-to-Many Relationship Only one entity of the first set is related to multiple entities of the second set. Example: A teacher teaches students. Only one teacher is teaching many students. This can be expressed in the following diagram as:
Many-to-One Relationship Multiple entities of the first set are related to only one entity of the second set. Example: Teachers teach a student. Many teachers are teaching only one student. I can be expressed in the following diagramn as :
- Attributes on Relationships :-
For example, consider the relationship Advertises, which associates the Newspaper and PropertyFor Rent entity types as shown below:
To record the date the property was advertised and the cost, we associate this information with the Advertises relationship as attributes called dateAdv and cost, rather than with the Newspaper or the PropertyForRent entities.
- Developing an E-R Diagram :-
Consider the following simple statement:
- Advantages and Disadvantages of E-R Model :-
Advantages of ER model :-
- Conceptual Simplicity E-R model represents the concepts of a database along with its entitiao and relationships in an easy way. It becomes even easier to create and age complex database designs by using E-R model.
- Visual Representation E-R model provides a visual representation of data and the relationships amone data. It helps the database designers, programmers and end users to understand the structure of data in an easy way. It also minimizes the data redundancy.
- Effective Communication tool The data base designer can use E-R model to get different views of data as seen by programmers, managers and end users etc. E-R model works as an effective communication tool to integrate these views.
- Integrated with Relational Database Model ration E-R model is well integrated with the relational database model. This integrau makes relational database design a very structured process.
Disadvantages of ER model :-
- Popular for High-level Design The E-R Model is especially popular for high-level database design.
- No Industry Standard There is no industry standard notation for developing an E-R diagram.
- Limited Relationship Representation E-R model represents limited relationships among the entities
- ENHANCED ENTITY-RELATIONSHIP MODELING (EER MODEL)
Enhanced ER model (EER model) is the extension of the original ER model with new modeling constructs. The new modeling constructs introduced in the EER model are supertype (superclass) / subtype (subclass) relationships. The supertype allows us to model general entity type whereas the subtype allows us to model specialized entity types.
- Supertype or Superclass :-
- Generalization, Specialization and Aggregation :-
In generalization, a number of entities are brought together into one generalized entity based on their similar characteristics.
Specialization is the opposite of Generalization. In specialization, a group of entities divided is into sub-groups based on their characteristics.
ISA relationship supports attribute inheritance and relationship participation. EER ln tne diagram, the subclass relationship is represented by IS A relationship. Attip Ertance 15 the property by which subclass entities inherit values for all attributes supercdass