Chapter 2 - Database Models
Chapter 2 - Database Models
Chapter Two
Database Model
A database model is a conceptual description of how the database works. It describes how
the data elements are stored in the database and how the data is presented to the user
and programmer for access; and the relationship between different items in the database.
A specific DBS has its own specific Data Definition Language, but this type of language is too
low level to describe the data requirements of an organization in a way that is readily
understandable by a variety of users. We need a higher-level language. Such a higher-level
is called database model.
Database Model: a set of concepts to describe the structure of a database, and certain
constraints that the database should obey.
A database model is a description of the way that data is stored in a database. Database
model helps to understand the relationship between entities and to create the most
effective structure to hold data.
Database Model is a collection of tools or concepts for describing:
− Data
− Data relationships
− Data semantics
− Data constraints
The main purpose of database model is to represent the data in an understandable way.
Categories of database models include:
− Object-based
− Record-based
− Physical
Department
Employee Job
2. Network Model
The network is a conceptual description of databases where many-to-many (multiple
parent-children) relationships exist. To make this model easier to understand, the
relationships between the different data items are commonly referred to as sets to
distinguish them from the strictly parent-child relationships defined by the HDBM.
Like the HDBM, NDBMs can very quickly be searched, especially through the use of index
pointers that lead directly to the first item in a set being searched. The NDBM suffers from
the same structural problem as the HDBM; the initial design of the database is arbitrary,
and once its setup, any changes to the different sets require the programmer to create an
entirely new structure. The dual problems of duplicated data and inflexible structure led to
the development of a database model that minimizes both problems by making
relationships between the different data items the foundation for how the database is
structure.
Department Job
Employee
Activity
Time Card
The primary purpose behind the relational database model is the preservation of data
integrity. To be considered truly relational, a DBMS must completely prevent access to the
data by any means other than queries handled by the DBMS itself. While the relational
model does not specify how the data is stored on the disk, the preservation of data integrity
implies that the data must be stored in a format that prevents it from being accessed from
outside the DBMS that created it.
The relational model also requires that the data be accessed through programs that don’t
rely on the position of the data in the database. This is in direct contrast to the other
database models, where the program has to follow a series of pointers to the data it wants.
A program querying a relational database simply asks for the data it wants, and it is up to
the DBMS to do the necessary searches and provide the answer. Searches can be speed up
DMU Department of Software Engineering 5
Chapter Two: Database Models November, 2018
by creating an index on one or more columns in a table; however, the DBMS controls and
uses the index. The user has only to ask the DBMS to create the index, and it will be
maintained and used automatically from that point on.
The relational database model has a number of advantages over the other models. The
most important is its complete flexibility in describing the relationships between the
various data items. Once the tables are created and relationships defined then users can
query the database on any of the individual columns in a table or on the relationships
between the different tables.
Changing the structure of the database objects is as simple as adding or deleting columns
in a table. Creating new tables, deleting old tables etc. are also very simple. The major tasks
that the designers of a relational database has to make concerns the definitions of the
tables and their relationships in the database.
Generally, Relational database model is
− Developed by Dr. Edgar Frank Codd in 1970 (famous paper, 'A Relational Model for Large
Shared Data Banks').
− Terminologies originates from the branch of mathematics called set theory and relation.
− Can define more flexible and complex relationship.
− Viewed as a collection of tables called “Relations” equivalent to collection of record
types.
− Relation: Two dimensional table.
− Stores information or data in the form of tables → rows and columns.
− A row of the table is called tuple→ equivalent to record.
− A column of a table is called attribute→ equivalent to fields.
− Data value is the value of the Attribute.
− Records are related by the data stored jointly in the fields of records in two tables or
files. The related tables contain information that creates the relation.
− The tables seem to be independent but are related some how.
− No physical consideration of the storage is required by the user.
DMU Department of Software Engineering 6
Chapter Two: Database Models November, 2018
− Many tables are merged together to come up with a new virtual view of the relationship.
Alternative terminologies
Relation Table File
Tuple Row Record
Attribute Column Field