DBMS
Database models
History of data models
• 1960’s – Navigational DBMS which involved
the manual navigation of a linked data set
formed into a large network.
• 1970s relational DBMS – data was normalized
into tables. It used a key that uniquely
identified each record. It required several
loops to collect information about one record.
It is attributed to Edgar Codd.
Lecture 1 - DBMS 2
History continued…
• 1980’s – object oriented DBMS – data was
treated as objects.
• Current trends – there are advancements to cater
for various business needs. i.e
– Access by handheld devices.
– Search engine queries to locate info from the WWW.
– Data warehousing facilities.
– Online transactions
– E-payments and M-payments.
Lecture 1 - DBMS 3
What is a data model?
The data model is an abstract model that organizes elements
of data in a certain format
A data model defines the structure of the data and the format
of data storage.
Database models
– Hierarchical Database Model
– Network Databases Model
– Relational Database
– Object Oriented Database Model
– Deductive Database Model
5
Hierarchical model
In a hierarchical model, data is organized into a tree-like
structure, implying a single parent for each record. A sort
field keeps sibling records in a particular order. Hierarchical
structures were widely used in the early mainframe database
management systems, such as the Information Management
System
This structure allows one-to-many relationship between two
types of data.
This structure is very efficient to describe many relationships
in the real world; recipes, table of contents, ordering of
paragraphs/verses, any nested and sorted information.
This hierarchy is used as the physical order of records in storage.
Record access is done by navigating downward through the data
structure using pointers combined with sequential accessing.
Because of this, the hierarchical structure is inefficient for certain
database operations when a full path (as opposed to upward link
and sort field) is not also included for each record. Such
limitations have been compensated for in later IMS versions by
additional logical hierarchies imposed on the base physical
hierarchy.
Advantages
Performance: the navigation among records in a hierarchical
database model is very fast because the child/parent relationship
is implemented with pointer from one data record to another
Ease of understanding: the organization of a database
resembles an organization chart therefore even non-
programmers can easily understand
Disadvantages
It is a rigid structure hence difficult to add or change file in a
record type and may require creating an entire record type or
data structure
Network model
The network model expands upon the hierarchical structure,
allowing many-to-many relationships in a tree-like structure that
allows multiple parents.
The network model organizes data using two fundamental
concepts, called records and sets.
Records contain fields (which may be organized hierarchically, as
in the programming language COBOL). Sets define one-to-many
relationships between records: one owner, many members. A
record may be an owner in any number of sets, and a member in
any number of sets.
A set consists of circular linked lists where one record type, the
set owner or parent, appears once in each circle, and a second
record type, the subordinate or child, may appear multiple times
in each circle.
In this way a hierarchy may be established between any two
record types, e.g., type A is the owner of B. At the same time
another set may be defined where B is the owner of A.
Access to records is either sequential (usually in each record
type) or by navigation in the circular linked lists.
The network model is able to represent redundancy in data more
efficiently than in the hierarchical model, and there can be more
than one path that can cross databases
from an ancestor node to a descendant.
Popular DBMS products that utilized network model were
Cincom Systems' Total and Cullinet's IDMS..
Advantages
Performance: navigation of records is fast as the set relationship
is implemented by means of pointers
Disadvantages
It allow data redundancy-the many-to-many relationship may
bring about data duplication
Relational model
The relational model was introduced by E.F. Codd in 1970[1] as a
way to make database management systems more independent of
any particular application
Three key terms are used extensively in relational database
models: relations, attributes, and domains. A relation is a table with
columns and rows. The named columns of the relation are called
attributes, and the domain is the domain is the set of values the
attributes are allowed to take.
Relational databases
• Data is logically structured within tables(relations).
• Each relation has a name.
• Each table corresponds to an entity.
• The rows of a table are called tuples and represents an
instance of that entity.
• The columns of a table are called attributes.
• Every attribute has a data type associated with it.
• Every attribute has a domain which provides the set of
all possible values that can be stored as values for that
attribute.
• Table names are called relational variables.
Terms in relational databases
• Relation – is a table with columns and rows.
• Attribute – is a named column of a relation.
• Domain – is a set of allowable values for one or more attributes.
• Tuple – refers to a row of a relation.
• Degree – the degree of a relation is the number of attributes it
contains.
• Cardinality – the cardinality of a relation is the number of tuples it
contains.
• Relational database – a collection of normalized relations with
distinct relation names.
• Relational schema – a named relation defined by a set of attribute
and domain name pair.
• Relational database schema – a set of relations each with a distinct
name.
Properties of relations
• A table is perceived as a two-dimensional
structure composed of rows and columns.
• Each table row (tuple) represents a single entity
occurrence within the entity set.
• Each table column represents an attribute, and
each column has a distinct name.
• Each row/column intersection represents a single
data value.
Properties of relations
• A table is perceived as a two-dimensional
structure composed of rows and columns.
• Each table row (tuple) represents a single entity
occurrence within the entity set.
• Each table column represents an attribute, and
each column has a distinct name.
• Each row/column intersection represents a single
data value.
• Relational Model Example:
Snum Sname City Comm
1001 Peel London .12
1002 Serres San Jose .13
1004 Motika London .11
Snum= unique number for each salesperson
Sname=name of salesperson
Comm = commission rate
19
Advantages of relational model
Ease of use; the alteration of any information or records is
much easier to understand.
Flexibility; different tables from which information to be
linked and extracted can be easily manipulated by operators
Precision; the usage of relation algebra and relation calculus
in the manipulations of the relation between the tables
ensures that there no ambiguity.
Object Oriented Database Model
– Represents an entity as a class
• A class captures both attributes and behavior
– Instances of the class are called objects
– Within an object the class attributes take on specific
values which distinguish one object from another
– Does not restrict to native data types such as
real,integer, can use other objects
• Object Oriented Example
– Class
• Cat
– Attributes
• Color, weight, breed
– Behavior
• Scratches, sleeps,purrs
– An instance of the cat class is an object with specific attributes
• Example – an attribute of a cat can be owner and the owner can
be a student object
Deductive Database Model
– Also known as inferential model
– Stores data and elementary facts called axioms
– Other facts can be derived as needed
– Ex. Fact Student owns cat :stuOwnsCat(S,C)
– Can deduct if two students own the same cat and
deduct new relationship: catmates.