Data Model in DBMS
A database model or simply a data model is an abstract model that describes how the data are represented and used. A data model consists of a set of data structures and conceptual tools, which is used to describe the structure of a database. Depending on the concept used to model the structure of the database, data models are categorized into three types, namely -
- High-level or conceptual data models
- Representational or implementation data models
- Hierarchical data model
- Network data model
- Relational data model
- Object-based data model
- Low-level or physical data models.
Conceptual data model: A conceptual data model describes the information used by an organization in a way that is independent of any implementation-level issues and details. The main advantage of the conceptual data model is that it is independent of implementation details and, hence, can be understood even by the end users having non-technical background. The most popular conceptual data model is the entity-relationship model.
Representational data model: The representational or implementation data models hide some data storage details from the users; however, they can be implemented directly on a computer system.
Physical data model: The physical data model describes the data in terms of a collection of files, indices and other storage structures such as record formats, record ordering and access paths. This model specifies how the database will be executed in a particular DBMS software such as Oracle, Sybase, etc. by taking into account the facilities and constraints of a given database management system. It also describes how the data are stored on a disk and what access methods are available to it.
Hierarchical Model in DBMS
This database model organises data into a tree-like-structure, with a single root, to which all the other data is linked. The heirarchy starts from the Root data, and expands like a tree, adding child nodes to the parent nodes.
In this model, a child node will only have a single parent node.
This model efficiently describes many real-world relationships like index of a book, recipes etc.
In hierarchical model, data is organised into tree-like structure with one one-to-many relationship between two different types of data, for example, one department can have many courses, many professors and of-course many students.
Network Model in DBMS
Views 20
A network model is a database model that is designed as a flexible approach to representing objects and their relationships. A unique feature of the network model is its schema, which is viewed as a graph where relationship types are arcs and object types are nodes. Unlike other database models, the network model's schema is not confined to be a lattice or hierarchy; the hierarchical tree is replaced by a graph, which allows for more basic connections with the nodes.
Charles Bachman was the original inventor of the network model. In 1969, the Conference on Data Systems Languages (CODASYL) Consortium developed the network model into a standard specification. A second publication was introduced in 1971, which later turned into the basis for virtually all implementations.
The benefits of the network model include:
- Simple Concept: Similar to the hierarchical model, this model is simple and the implementation is effortless.
- Ability to Manage More Relationship Types: The network model has the ability to manage one-to-one (1:1) as well as many-to-many (N: N) relationships.
- Easy Access to Data: Accessing the data is simpler when compared to the hierarchical model.
- Data Integrity: In a network model, there's always a connection between the parent and the child segments because it depends on the parent-child relationship.
- Data Independence: Data independence is better in network models as opposed to the hierarchical models.
The drawbacks of the network model include:
- System Complexity: Each and every record has to be maintained with the help of pointers, which makes the database structure more complex.
- Functional Flaws: Because a great number of pointers is essential, insertion, updates, and deletion become more complex.
- Lack of Structural Independence: A change in structure demands a change in the application as well, which leads to lack of structural independence.
Relational Model in DBMS
What is Relational Model
The relational model represents the database as a collection of relations. A relation is nothing but a table of values. Every row in the table represents a collection of related data values. These rows in the table denote a real-world entity or relationship.
The table name and column names are helpful to interpret the meaning of values in each row. The data are represented as a set of relations. In the relational model, data are stored as tables. However, the physical storage of the data is independent of the way the data are logically organized.
Some popular Relational Database management systems are:
- DB2 and Informix Dynamic Server - IBM
- Oracle and RDB – Oracle
- SQL Server and Access - Microsoft
The advantages and disadvantages of a relational model are as follows:
Advantages:
- Relational model is easy to understand.
- Data can be managed properly in it.
- It provides structured query language to manage data, which is very easy to learn. DDL and DML are simpler in respect to the other models.
- Transactions can be managed properly.
- Many-to-many relationships can be represented through primary and foreign key and without any complexity.
- Insert, delete, and update operations can be performed without any loss of data.
- Data dictionary management is provided.
Disadvantage:
- It is difficult to handle due to complex data types.
Object-oriented data models in DBMS
In object-oriented data models entity is represented as a class. A class within it contains data and methods. Data are attributes of object and methods are behaviour. Object-oriented supports abstract data types, i.e., one class may contain another class as its attribute.Object-oriented data model is ideal for complex data types, such as video, audio, image. Object-oriented databases support all the features of object-oriented methodology, such as message passing (methods can pass messages to other objects), class inheritance, method overriding, encapsulation, polymorphism, and operator overloading.
Following are the advantage and disadvantages of an object-oriented data model:
Advantage:
- It is easy to handle complex data types.
Disadvantages:
- It is difficult to understand and use compared to relational model.
- It does not have ad hoc query capability.
- Integrity issues are involved. On updation or deletion of parent object, child object is not updated or deleted automatically. Procedural code should be written for that.
- Object-oriented systems are procedural, which are 3GL languages. It does not support SQL which is 4GL. Therefore, it is a step back from 4GL to 3GL.
- Data dictionary is not managed automatically. Staff is required to do so.
Entity Relationship Model in DBMS
The Entity-Relationship Model is the most popular conceptual model used for designing a database. It was originally proposed by Dr Peter Chen in 1976 as a way to unify the network and relational database views. The E-R model views the real world as a set of basic objects (known as entities), their characteristics (known as attributes) and associations among these objects (known as relationships). The entities, attributes and relationships are the basic constructs of an E-R model.
Advantages of E-R model
- It is simple and easy to understand and, thus, can be used as an effective communication tool between the database designer and the end user.
- It captures the real-world data requirements in a simple, meaningful and logical way.
- It can be easily mapped to the relational model. The basic constructs, that is, the entities and attributes of the E-R model can be easily transformed into relations (or tables) and columns (or fields) in a relational model.
- It can be used as a design plan and can be implemented in any database management software.
Entity:
An entity is a distinguishable object that has an independent existence in the real world. It includes all those ‘things’ of an organization about which the data are collected. For example, each book, publisher and author in an Online Book database is an entity. An entity can exist either physically or conceptually.
Tangible entity:
If an entity has a physical existence, it is termed as tangible or concrete entity. For example, a book, an employee, a place or a part.
Non-tangible:
If an entity has a conceptual existence, it is termed as non-tangible or abstract entity. For example, an event, a job title or a customer account.
ER Diagram
Views 38
ER Diagrams
- ERD stands for Entity Relationship diagram.
- It is a graphical representation of an information system.
- ER diagram shows the relationship between objects, places, people, events etc. within that system.
- It is a data modeling technique which helps in defining the business process.
- It used for solving the design problems.
Features of ER Model
- This model is widely used to develop the initial design of the database.
- This model provides a collection of basic concepts which can be easily implemented in a database system.
- It describes data as a set of entities, attributes, and relationships.
- It provides the graphical or conceptual view of the database design.
Uses of Entity-Relationship Model:
- ER models can be used in designing the database.
- It provides useful concepts that allow a user to move from an informal description to precise description.
- This model or diagram was developed to facilitate database design by allowing the specification of the overall conceptual structure of a database.
- It is widely useful in mapping the meanings and interactions of real world enterprises onto a conceptual schema.
- These models can be used for the logical or conceptual design of database applications.
Advantages of ER Model
- Entity-Relationship Diagram or model is easy to create and understand.
- Entity-Relationship Model is very simple because if you know the relationship between attributes and entities, you can easily draw it.
- It is a tool for effective communication for database designer.
- It can be easily converted into a Relational Model by simply converting the ER Model into tables.
Limitations/Disadvantages of ER Diagram
Disadvantages of an Entity-Relationship Diagram include the following aspects:
- Entity-Relationship diagram is not suitable for those systems which contain semi-structured or unstructured data set.
- In the ER model, it is difficult to show data manipulation.
This model is especially popular for high-level design.
Importance of ER Model
- ER Model is plain and simple for designing the structure.
- It saves time.
- Without ER diagrams you cannot make a database structure & write production code.
- It displays the clear picture of the database structure.
No comments:
Post a Comment