What are Entity Types | Entity sets | Keys | Value Sets in DBMS ?

  •  Entity Types, Entity Sets, Keys, and Value Sets :-

  • Entity Types and Entity Sets :-  
A database usually contains groups of entities that are similar. For example, a company employing hundreds of employees may want to store similar information concerning each of the employees. These employee entities share the same attributes, but each entity has its own value(s) for each attribute.

  1. An entity type describes the schema or intension for a set of entities that share the same attributes.

  2.  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.  
           Entity type defines a collection (or set) of entities that have the same attributes. Each entity type in the database is described by its name and attributes.
            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 :-
                  An important constraint on the entities of an entity type is the key or uniqueness Constraint on attributes. An entity type usually has one or more attributes whose values are distinct for each individual entity in the entity set. Such an attribute is called a key attribute, and its values can be used to identify each entity uniquely.


  • Value Sets of Attributes :-
                 Each simple attribute of an entity type is associated witha value set, which specifies the Set of values that may be assigned to that attribute for each individual entity. For Example: If the range of ages allowed for employees is between 20 and 60, then we can specify the value set of the Age attribute of EMPLOYEE entity type to be the set of integer numbers between 20 and 60 .
  • Relationship :-
    The association among entities is called a 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-One Relationship:-  Only one entity of the first set is related to only one entity of the second set. Example: A teacher teaches a student. Only one teacher is teaching only one student. This can be expressed in the following diagram as:

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 :-
In E-R diagram, attributes can also be assigned to 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 :-
            Developing an E-R Diagram requires an understanding of the system and its Components. Let us take a very simple example:
 Consider the following simple statement:
  • Advantages and Disadvantages of E-R Model :-
Advantages of ER model :-
  1. 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. 
     
  2. 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.

  3.  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.

  4.  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 :-
  1. Popular for High-level Design The E-R Model is especially popular for high-level database design.

  2.  No Industry Standard There is no industry standard notation for developing an E-R diagram.

  3.  Limited Relationship Representation E-R model represents limited relationships among the entities 

  • ENHANCED ENTITY-RELATIONSHIP MODELING (EER MODEL) 
              The basic concepts of ER modeling are not powerful enough for some complex applications. Hence some additional semantic modeling concepts are required, which are being provided by Enhanced ER 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  :-
Supertype or superclass is a generic entity type that has a relationship with one or more subtypes
  •  Generalization, Specialization and Aggregation :- 
The E-R Model has the power of expressing database entities in a conceptual hierarchical manner. As the hierarchy goes up, it generalizes the view of entities, and as we go deep in the hierarchy, it gives us the detail of every entity included. Going up in this structure is called Generalization, where entities are clubbed together to represent a more generalized view.
            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
    Tags

    Post a Comment

    0 Comments
    * Please Don't Spam Here. All the Comments are Reviewed by Admin.