Entity Relationship Modeling | Database Normalization and Data Models

The entity-relationship model (or ER model) is a way of graphically representing the logical relationships of entities (or objects) in order to create a database. It uses ER diagram to document the conceptual data model. ER diagram consists of entities, attributes, and relationships and cardinalities. 




• Entity:
An entity can be a real-world object, either animate or inanimate, that can be easily identifiable. For example, in a school database, students, teachers, classes, and courses offered can be considered as entities. All these entities have some attributes or properties that give them their identity.

• Attributes Entities are represented by means of their properties, called attributes. All attributes have values. For example, a student entity may have name, class, and age as attributes.

• Relationship The association among entities is called a relationship. For example, an employee ”works at” a department, a student ”enrolls” in a course. Here, ”Works at” and ”Enrolls” are called relationships.

• Cardinalities:
Cardinality defines the number of entities in one entity set, which can be associated with the number of entities of other set via relationship set.

Related Post:
Database and Database Management System

Database Normalization:


 Database Normalization is a technique of organizing the data in the database. Normalization is a systematic approach of decomposing tables to eliminate data redundancy and undesirable characteristics like Insertion, Update and Deletion anomalies. It is a multi-step process that puts data into tabular form by removing duplicated data from the relation tables.

Normalization is used for mainly two purpose:

 A. Eliminating redundant (useless) data.
B. Ensuring data dependencies make sense i.e data is logically stored. Normalization rule are divided into following normal form.

  •  First Normal Form 
  •  Second Normal Form 
  • Third Normal Form
  •  BCNF

DBMS Components

There are four main components in DBMS
A. Data Model:
The data model defines the way data are conceptually structured. Example includes the hierarchical, network, relational, object-oriented, hypermedia and multidimensional models.

B. Data Definition Language
 DDLs are used to define the metadata of the database. i.e.; using this, we create schema, tables, constraints, indexes in the database. DDLs are also used to modify Schema, tables index etc. Basically, using DDL statements, we create skeleton of the database. It helps to store the metadata information like number of schemas and tables, their names, columns in each table, indexes, constraints etc in the database. Some of the DDL commands are Create, Rename etc.

C. Data Manupulation Language 
DML is used with thirdgeneration, fourth-generation or object-oriented languages to query the contents of the database, store or update information in the database, and develop database application. When we have to insert records into table or get specific record from the table, or need to change some record, or delete some record or perform any other actions on records in the database, we need to have some media to perform it. DML helps to handle user requests. It helps to insert, delete, update, and retrieve the data from the database. Select, Insert etc are the examples of DML.

D. Data Dictionary
 It stores definitions of data elements and data characteristics such as individuals, business functions, programs, and reports that use the data elements, as well as the physical representation, responsible parties in the organisation and security. Because the data dictionary provides standard definitions for all data elements, the potential for data inconsistency is reduced.


Data Models

A database model is a type of data model that determines the logical structure of a database and fundamentally determines in which manner data can be stored, organized, and manipulated. Different types:
A. Hierarchical model
B. Network model
C. Relational model
D. Object Oriented model


• Hierarchical Data Model
A hierarchical database is a design that uses a one-to-many relationship for data elements.
– Hierarchical database models use a tree structure that links a number of disparate elements to one ”owner”,or ”parent,” primary record.
– The data is stored as records which are connected to one another through links.
 – A record is a collection of fields, with each field containing only one value.
– The entity type of a record defines which fields the record contains.
– A record in the hierarchical database model corresponds to a row (or tuple) in the relational database model and an entity type corresponds to a table (or relation)
– The hierarchical database model mandates that each child record has only one parent, whereas each parent record can have one or more child records.
– In order to retrieve data from a hierarchical database the whole tree needs to be traversed starting from the root node.
– This model is recognized as the first database model created by IBM in the 1960s


Advantages:

  • Speed of access is faster because of the predefined data paths. 


Disadvantages:

  • Complex implementation 
  • Predefined tree structure reduces flexibility. 
  • Difficult to manage.


• Network Database Model
A network database model is a database model that allows multiple records to be linked to the same owner file.
– The model can be seen as an upside down tree where the branches are the member information linked to the owner, which is the bottom of the tree.
– The multiple linkages which this information allows the network database model to be very flexible.
– In addition, the relationship that the information has in the network database model is defined as many-to-many relationship because one owner file can be linked to many member files and vice versa.

Advantages:

  •  Because it has the many-many relationship, network database model can easily be accessed in any table record in the database. 
  • For more complex data, it is easier to use because of the multiple relationship founded among its data. 
  • Easier to navigate and search for information because of its flexibility 


Disadvantage: 

  • Difficult for first time users.
  • Difficulties with alterations of the database because when information entered can alter the entire database.

• Relational Database Model

Data is stored in tables called relations.
– Relations can be normalized.
– In normalized relations, values saved are atomic values.
– Each row in a relation contains a unique value. – Each column in a relation contains values from a same domain.

Advantages:

  • Ease of use 
  • Flexibility: 
  • Precision: 
  • Security: 
  • Data Independence: 
  • Data Manipulation Language 


Disadvantages :

  • Performance 
  • Physical Storage Consumption

No comments

Powered by Blogger.