0% found this document useful (0 votes)
11 views

Data Models

A data model defines the structure of a database including the data types, relationships, and constraints. Common types of data models include record-based models like hierarchical, network, and relational; object-based models like object-relational and entity-relationship; and physical data models. The relational model organizes data into tables with rows and columns and allows querying and joining of tables through matching field values. A physical data model represents how the logical data model will be implemented in terms of database tables, columns, keys and relationships.

Uploaded by

sammarmughal77
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views

Data Models

A data model defines the structure of a database including the data types, relationships, and constraints. Common types of data models include record-based models like hierarchical, network, and relational; object-based models like object-relational and entity-relationship; and physical data models. The relational model organizes data into tables with rows and columns and allows querying and joining of tables through matching field values. A physical data model represents how the logical data model will be implemented in terms of database tables, columns, keys and relationships.

Uploaded by

sammarmughal77
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 5

Data Models

A data model is a collection of concepts that can be used to describe the structure of a
database whereas structure of a database means the data types, relationships and constraints
that should hold on the data.

A database model determines in which manner data can be stored, organized, and manipulated
in a database system. A database model is a theory or specification describing how a database is
structured and used. Several such models have been suggested.

Common types of data models include:

1. Record-Based Data Models


a. Hierarchical model
b. Network model
c. Relational model
2. Object-Based Data Models
a. Object-relational model
b. Semantic
c. Entity-relationship
3. Physical Data Models

1. Record-Based Data Models


a. Hierarchical model

The hierarchical data model organizes data in a tree structure. There is a hierarchy of
parent and child data segments known as Record Type. Data in a series of records, which have a
set of field values attach to it. It collects all the instances of a specific record together as a
record type. These record types are the equivalent of tables in the relational model, and with
the individual records being the equivalent of rows. To create links between these record types,
the hierarchical model uses Parent Child Relationships. These are a 1:N mapping between
record types. For example, an organization might store information about an employee, such as
name, employee number, department, salary. The organization might also store information
about an employee's children, such as name and date of birth. The employee and children data
forms a hierarchy, where the employee data represents the parent record type and the children
data represents the child record type. If an employee has three children, then there would be
three child segments associated with one employee segment. In a hierarchical database the
parent-child relationship is one to many. This restricts a child segment to having only one
parent segment. Hierarchical DBMSs were popular from the late 1960s, with the introduction of
IBM's Information Management System (IMS) DBMS, through the 1970s.

Parent–child relationship: Child may only have one Parent but a mother can have
multiple children. Parents and children are tied together by links called "pointers". A mother will
have a list of pointers to each of her children.

b. Network model

Some data required to be modeled with more than one parent per child. So, the
network model permitted the modeling of many-to-many relationships in data. In 1971, the
Conference on Data Systems Languages (CODASYL) formally defined the network model. The
basic data modeling construct in the network model is the set construct. A set consists of a set
name, an owner record type, and a member record type. A member record type can have that
role in more than one set; hence the multi parent concept is supported. An owner record type
can also be a member or owner in another set. The CODASYL network model is based on
mathematical set theory.
c. Relational model

A database based on the relational model developed by E.F. Codd. A relational database
allows the definition of data structures, storage and retrieval operations and integrity constraints.
In such a database the data and relations between them are organized in tables. A table is a
collection of records and each record in a table contains the same fields.

Properties of Relational Tables:


 Values in cells Are Atomic
 Each Row is Unique
 Column Values Are of the Same Kind
 The Sequence of Columns is Insignificant
 The Sequence of Rows is Insignificant
 Each Column Has a Unique Name

Certain fields may be designated as keys, which means that searches for specific values
of that field will use indexing to speed them up. Where fields in two different tables take values
from the same set, a join operation can be performed to select related records in the two tables by
matching values in those fields. Often, but not always, the fields will have the same name in both
tables. This can be extended to joining multiple tables on multiple fields because these
relationships are only specified at retrieval time. The RELATIONAL database model is based on
the Relational Algebra (discuss later on).
Relational Database Terminology.

 Relation.
In a relation model, data is stored in relation. Relation is another term used for a
table.
 Tuple.
Every relation consists of many tuples. Tuples are also called records or rows.
 Attribute.
An attribute is a column of a relation.
 Domain.
A collection of all possible values of one or more attributes.
 Degree.
The number of attributes is called the degree of that relation.
 Cardinality.
The number of tuples is called the cardinality of that relation.

2. Object-Based Data Models


a. Object-Oriented Model
This model adds database functionality to object-Oriented programming languages. A
major benefit of this approach is the unification of the application and database development
into a seamless data model. As a result, applications require less code and easier to develop
and maintain. Developers can write complete database applications with a modest amount of
additional effort.

b. Semantic data model


The logical data structure of a database management system (DBMS), whether hierarchical
University Object Diagram
network, or relational, cannot totally satisfy the
STUDENT requirements for a conceptual definition of data because it
is limited in scope and more toward the implementation
strategy employed by the DBMS. Therefore, the need to
define data from a conceptual view has led to the
TEACHER development of semantic data modeling techniques. That
is, techniques to define the meaning of data within the
context of its interrelationships with other data.
DEPARTMENT
Semantics is a Greek word which is the study of meaning. A semantic data model is a technique
to define the meaning of data within the context of its
interrelationships with other data. The semantic objects are
used to represent or model the meaning of user’s data using different real life object. A semantic
data model is an abstraction which defines how the stored symbols/objects are relate to the real
world. A semantic data model is sometimes called a conceptual data model.
c. Entity-relationship model
An entity-relationship model (ERM) is an abstract conceptual data model used to
represent structured data. There are several notations (symbols) used for ERMs which we will
discuss in later lectures.

3. Physical data model


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.

The steps for physical data model design are as follows:

1. Convert entities into tables.

2. Convert relationships into foreign keys.

3. Convert attributes into columns.

4. Modify the physical data model based on physical constraints / requirements.

A logical data model describes your model entities and how they relate to each other. A
physical data model describes each entity in detail, including information about how you would
implement the model using a particular (database) product.

In a logical model describing a person in a family tree, each person node would have
attributes such as name(s), date of birth, place of birth, etc. The logical diagram would also show
some kind of unique attribute or combination of attributes called a primary key that describes
exactly one entry within this entity.

The physical model for the person would contain implementation details. These details
are things like data types, indexes, constraints, etc.

You might also like