Database Management System Contents What is Data Model

Database Management System Contents What is Data Model Types of Data Model Comparison among Data Models Entity-Relationship Model

Database Management System Data Models A database model is a specification describing how data is to arranged to serve a specific purpose. A data model tells what information is to be contained in database, how data items in the database will be related to each other and how information will be used. Data Models help to understand Each user’s data requirement Nature of the data independent of its physical representations. Use of data across application areas. It enhances the database reusability and reduces application maintainability.

Database Management System Data Models contains three components: Structural Part: Set of rules according to which data base is to be created. Manipulative Part: Defines types of operations allowed on database. Integrity Rules: Rules to insure the integrity of the database. Importance of Data Models: Graphical Representation of the complex real-world entities. Used as a blue print of the whole database. Simplicity in design and impressibility to distinguish between data and their relationships. Application independent. No Redundancy in data representation. Simplifies the implementation of constrains, stored procedures, and other integrity rules.

Database Management System Data Models Every Data Model must contain four basic building blocks: Entity: Any real-world element about which data is available, can be collected and processed.

Database Management System Data Models Attribute: A characteristic of an Entity called field on DBMS

Database Management System Data Models Relationship: An association among two or more entities.

Database Management System Data Models Constraint: Restriction placed on the data. Constraint Name Not Null Check Unique Primary Key Foreign Key

Database Management System Data Models ◦ ◦ Types of Data Models: Three basic types of data models are Hierarchical Model Network Model Relational Model Hierarchical Model: This is the oldest data model. In this database is organized in the from of tree from top to bottom, consists of a hierarchy of nodes with a single central node called- Root. Each node can have any number of sub-nodes This data model works on Parent- Child (1 -to-N) and Child-Parent (Nto-1)relationship. To access the database, user has to start from the top node “Root”. Every node represents a record and every edge represents a relation.

Database Management System Data Models

Database Management System Data Models Hierarchical Model: Advantages: Simplicity. ◦ Security. ◦ Data Integrity ◦ Efficiency. ◦ ◦ ◦ Disadvantages: Complex physical implantation and maintenance. Inflexible. Difficult to operate. Platform and structure dependent. Relationships among data become complex on N: N level

Database Management System Data Models Network Model: ◦ Limitations of Hierarchical model lead to the development of Network Model. It can handle N: N relationship effectively. ◦ Use direct graphs allowing child node to have many parents so don’t use parent-child structure. ◦ It’s a network structure consisting nodes and branches where each node can have a link to many other nodes.

Database Management System Data Models Network Model: ◦ ◦ ◦ ◦ Advantages: Handles N: N relationships among data. Data Independence. Data Integrity Efficient data accessibility. Disadvantages: Complex. structure dependent. Operational Anomalies.

Database Management System Data Models ◦ ◦ ◦ Relational Model : This model was developed by Dr. E. F. Codd in 1970. Today it is the most widely used database model. The main significant of this model is to separate logical and physical view of the data. In this model, data is organized in the form of rows and columns. Any two tables can be linked together irrespective of their hierarchical placement. Different tables can connect with each other through common attribute

Database Management System Data Models Relational Model :

Database Management System Data Models Relational Model :

Database Management System Data Models Relational Model : Properties of a Relation ◦ ◦ ◦ Values are atomic. Column values must be of same kind. Each row is unique. Sequence of columns is insignificant. Sequence of rows is insignificant. Each column must have a unique name Eid Ename Deptt. Salary Address 102 Anil Sales 35000 38 -B Chennai. 103 Sunil Finance 55000 49 -D Mumbai

Database Management System Data Models Relational Model: Advantages: ◦ ◦ ◦ ◦ Simples data model. Flexible Data and structure Independence. Efficient data accessibility. Disadvantages: Costly. No specific handling for binary files. Simplicity may lead to bad designing.

Database Management System Data Models Entity-Relationship Model: ◦ ◦ ◦ E-R Model was developed by P. P. Chen in 1976. It is high-level visual description of the data and relationship among the data rather than how data is stored. It focuses on identifying the entities and the relationship among them. The relationship among entities can be 1: 1, 1: N, M: N Each E-R Model has following components.

Database Management System Data Models Entity-Relationship Model: Entity Any Real World Object Attributes Characteristic of Entity Relationships Connection among Entities Degree of Relationships Number of Entities associated with a Relationship Cardinality of Relationships Number of one entity instances connected to one instance of another entity Connectivity of Relationships Number of entity instances connected to number of instances of another entity Direction of Relationships Entity from which the relationship starts and connect to which entity.

Database Management System Data Models ◦ ◦ ◦ ◦ ◦ Features of the E-R Model: E-R models can be easily converted into Relations (Relational Model). In E-R model real world problems can be decomposed to develop the database easily. Provides a visual view of the data and relations. Helps database designers to identify the user’s data requirement. Simple, non-technical, free of ambiguities easy-to-understand tool. Provides a standard and logical representation of the data. It gives precise understanding of the nature of the data and how it will be used. It is a top-down approach. Scalable and flexible.

Database Management System Data Models Symbols used in ER Model:

Database Management System Data Models ER Model Example:

Database Management System Data Models ER Model Example: ◦ Create an E-R model for a book purchase order.

Database Management System Data Models E-R Model: Advantages: ◦ ◦ ◦ Conceptual simplicity. Visual Representation. Effective communication Tool Integrated with Relational Database Model Disadvantages: No Industry standard Limited relationship representation.

Chapter End
- Slides: 25