Download Data Models - Lsp4you.com

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Relational algebra wikipedia , lookup

Entity–attribute–value model wikipedia , lookup

Extensible Storage Engine wikipedia , lookup

Database wikipedia , lookup

Clusterpoint wikipedia , lookup

Relational model wikipedia , lookup

Database model wikipedia , lookup

Transcript
Learners Support Publications www.lsp4you.com
DATA MODELS
• A collection of conceptual tools for
describing data, data relationships, data
semantics, and consistency constraints.
• Provide a way to describe the design of a
database at the logical level.
• Three data models that
database management are:
are
used
1. The Relational Data Model
2. The Hierarchical Data Model
3. The Network Data Model
for
Learners Support Publications www.lsp4you.com
The Relational Data Model
• In this model,the data is organized into
tables (ie., rows and columns). These tables
are called relations.
• A row in a table represents a relationship
among a set of values.
Consider a sample database with three tables
(relations):Suppliers, Items, Quantities:
Suppliers (sup-no#,sup-name,status, city)
Items ( item-no#, item-name, price)
Quantities (sup-no#, item-no#, Qty)
Learners Support Publications www.lsp4you.com
Suppliers
Sup-no#
Sup-Name
Status
City
S1
S2
S3
Britannia
New
Cockg
10
30
10
Delhi
Mumbai
Delhi
Items
Item-no#
Item-name
Price
I1
I2
I3
I4
I5
I6
Milk
Cake
Bread
Biscuit
Ice cream
Jam
15.00
5.00
9.00
14.00
6.00
10.00
Quantities
Sup-no#
Item-no#
Qty
S1
S1
S1
S2
S2
S3
I2
I3
I6
I4
I5
I1
10
20
20
20
10
10
Learners Support Publications www.lsp4you.com
• Rows of relations are generally referred to
as tuples and the columns are usually
referred to as attributes.
• No two tuples are identical
ordering is not important.
and
their
• A relationship is represented by combining
the primary key of the relations.
• various operations can be performed on
relations such as insert new tuples, delete
tuples and modify tuples.
• There are several languages for expressing
these operations. One such language is
relational query language.
Learners Support Publications www.lsp4you.com
The Network Data Model
• In this model, data is represented by
collections of records and relationships
among data are represented by links. Ie.,
the
collection
of
records
which
are
connected to one another by means of links.
•A
record
is
a
collection
of
fields
(attributes), each of which contains only
one data value.
• A link is an association between precisely
two records.
• The structure of the database is shown as
an arbitrary graph in which the records
form the nodes and links form the edges.
• There is no concept of a root node.
Learners Support Publications www.lsp4you.com
Consider the structure of the above sample
database of suppliers, items and quantities.
S1 Britannia
10 Delhi
10
I1 milk
S2
20
15
I2
cake
New
20
5
I3 bread
30
Mumbai
S3
20
9 I4 biscuit
Cockg
10
14
10
Delhi
10
I5 icecream 6 I6 jam 10
Learners Support Publications www.lsp4you.com
• The operations on a network database are
performed through a data manipulation
language for network model.
• The operations that can be performed on
a network database include find, insert,
delete, modify etc.
• The
inserting
or
removing
records
include connect, disconnect and reconnect
operations.
Learners Support Publications www.lsp4you.com
The Hierarchical Data Model
•Same as network model. The only difference
is that in the hierarchical model, records
are organized as trees rather than arbitrary
graphs.
•The record type at the top of the tree is
usually known as root.
•In general, the root may have any number of
dependents and each of these dependents may
have any number of low level dependents and
so on.
Consider the hierarchical view of the above
sample database of suppliers, items and
quantities.
Learners Support Publications www.lsp4you.com
S1
Britannia
I2
I3
I6
10
Delhi
Cake
5
Bread
Jam
9
10
10
20
20
S2
New
30
I4
I5
Mumbai
Biscuit
Icecream
14
6
20
10
S3
Cockg
10
I1
Milk
Delhi
15
10
Learners Support Publications www.lsp4you.com
In this tree structure supplier record type
is the root node.
•Here the relationship is expressed in the
form of a tree with all the edges
pointing
to the leaf.
•The operations on a hierarchical database
are performed through a data manipulation
language for hierarchical data model.
•The various operations include retrieval,
insertions , deletions and modifications of
records.
Learners Support Publications www.lsp4you.com