Monday 28 December 2015

Entity Relationship Model

Entity Relationship Model

                    The ER model defines the conceptual view of a database. The ER model is considered a good option for designing databases.
Entity:
           An entity is an existing or real thing. For example, in a school database, students, teachers, classes, and courses offered can be considered as entities.
           An entity set is a collection of similar types of entities. An entity set may contain entities with attribute sharing similar values. For example, a Students set may contain all the students of a school; likewise a Teachers set may contain all the teachers of a school from all faculties. 
           It is relatively easy to understand, and hence, the most widely used one in designing a database. 


Advantages

  1. Straightforward relation representation: Having designed an E-R diagram for a database application, the relational representation of the database model becomes relatively straightforward.
  2. Easy conversion for E-R to other data model: Conversion from E-R diagram to a network or hierarchical data model can· easily be accomplished.
  3. Graphical representation for better understanding: An E-R model gives graphical and diagrammatical representation of various entities, its attributes and relationships between entities. This is turn helps in the clear understanding of the data structure and in minimizing redundancy and other problems.

Wednesday 23 December 2015

Data Model

Data Modeling

  • Conceptual
  • Logical
  • Physical Data Models



Compare these three types of data models.


Conceptual Data Model
                     
A conceptual data model identifies the highest-level relationships between the different entities. Features of conceptual data model include:

  1. Includes the important entities and the relationships among them.
  2. No attribute is specified.
  3. No primary key is specified.



Logical Data Model
                  A logical data model describes the data in as much detail as possible, without regard to how they will be physical implemented in the database. Features of a logical data model include:
  1. Includes all entities and relationships among them.
  2. All attributes for each entity are specified.
  3. The primary key for each entity is specified.
  4. Foreign keys (keys identifying the relationship between different entities) are specified.
  5. Normalization occurs at this level.
The steps for designing the logical data model are as follows:
  1. Specify primary keys for all entities.
  2. Find the relationships between different entities.
  3. Find all attributes for each entity.
  4. Resolve many-to-many relationships.
  5. Normalization.
Physical data mode
             Physical data model represents how the model will be built in the database. A physical database model shows all table structures, including column name, column data type, column constraints, primary key, foreign key, and relationships between tables. Features of a physical data model include:
  • Specification all tables and columns.
  • Foreign keys are used to identify relationships between tables.
  • Denormalization may occur based on user requirements.
  • Physical considerations may cause the physical data model to be quite different from the logical data model.
  • Physical data model will be different for different RDBMS. For example, data type for a column may be different between MySQL and SQL Server.

Monday 21 December 2015

Data Management Technique

 Database
A database is a collection of interrelated data organized in specific forms in order to suit for specific applications. A database is maintained by some organization or enterprise for efficiently handling the tasks of their daily activities, called transactions. For example bank maintains a banking database for storing customer data, account data, loan data and many others. 
Data are stored in several files with minimum amount of redundancy among them. Data must be shared in nature in order to facilitate concurrent access and processing. There must be a overall centralized control of data in order to maintain safety, security and integrity of database. A database, therefore, can be characterized as follows:


  1. Repository of collection of interrelated data records or data files.
  2. Data in a database are organized for efficient storage, retrieval and processing (in relation to some application). Data in a database must be shared in nature in order to facilitate concurrent access and processing.
  3. Database provides a centralized control of data to its users.
  4. Database is designed to maintain a large volume of data efficiently and effectively.


Database Management System
                Software that handles the storage, retrieval, and updating of data in a computer system.