Data modeling is part of the development process. In the linear development cycle, it is used during the system requirements phase to construct the data components of the analysis model. The model represents the major data objects and the relationships between them.
Data modeling is a technique for organizing and documenting a system’s data. Data modeling is sometimes called database modeling because a data model is eventually implemented as a database.
There are several notations for data modeling. The actual model is frequently called an entity relationship diagram (ERD) because it depicts data in terms of the entities and relationships described by the data.
An entity relationship diagram is defined as a data model utilizing several notations to depict data in terms of the entities and relationships described by that data.
The entity relationship (E-R) data model was developed to facilitate database design by allowing specification of an enterprise schema that represents the overall logical structure of a database. It is data oriented model of .a system. It has three Main components-data entities, their relationships and their associated attributes.
Entity : An entity is something about which the business needs to store data. It is most elementary thing of an organization about which data is to be maintained. Every entity has unique identity, which distinguishes it from another entity. An entity type is the description of all entities to which a common definition and common relationships and attributes apply. It is represented by rectangular box with the name of entity written inside.
For example: the data that describes a particular student might include name, address, phone number, date of birth etc.
Relationship : A relationship is a natural business association that exists between one or more entities. The relationship may represent an event that links the entities or merely a logical affinity that exists between the entities. Entities are connected to each other by relationships. It indicates how two entities are associated. A diamond notation with name of relationship represents as written inside.
Degree : The degree of a relationship is the number of entities that participate in the relationship. The most common relationships in 8-R diagram are unary, i.e., degree one, binary, i.e., degree 2 and ternary, i.e., degree 3.
Cardinality : Cardinality defines the minimum and maximum number of occurrences of one entity that may be related. to a single occurrence of the other entity. Because all relationships are bi-directional, cardinality must be defined in both directions for every relationship.
A popular graphical notation for cardinality is shown in figure below :
Attribute : Each entity type has a set of attributes associated with it. An attribute is a property or characteristic of an entity that is of interest to the organization. It is represented by oval shaped box with name of attribute written inside it.
Types of Attribute
- Simple attribute : There is no need to sub-divide it into component attributes. For example, if there is no need to refer to the individual component of an address (Zip, street and so on), then the whole address is designated as a simple attribute.
- Composite Attribute : On the other hand, it can be divided into subparts. For example, an attribute•name can be structured as a composite attribute consisting of first_name, middle_name, and last name.
- Single valued Attribute : Single valued attribute have a single value for a particular entity. For instance, the loan_number attribute for a specific loan entity refers to only one loan number. Such attributes are said to be single valued.
- Multivalued Attribute : There may be instances. where an attribute has a set of values for a specific entity. Consider an employee entity set with the attribute. phone-number. An employee may have zero; one or several phone numbers, and different employees may have different numbers of phones. This type of attribute is said to be multivalued.
- Derived Attribute : The value for this type of attribute can be derived from the values of other related attributes or entities. For example, the customer entity set has an attribute loan held, which represents how many loans a customer has taken from the bank. We can derive the value for this attribute by counting the number of loan entities associated with that customer.