Data Models - amu.ac.in · Relational Data Model •Relational model was first introduced by Ted...

24
Slide 1-1 Data Models SOURCE: Fundamentals of Database Systems (6th Edition) by Ramez Elmasi, Shamkant B. Navathe + Database System Concepts (English) 6th Edition by Abraham Silberschatz , S. Sudarshan , Henry F. Korth + Freely Accessible Web Resources Professor:Mohammad Ubaidullah Bokhari

Transcript of Data Models - amu.ac.in · Relational Data Model •Relational model was first introduced by Ted...

Page 1: Data Models - amu.ac.in · Relational Data Model •Relational model was first introduced by Ted Codd of IBM Research in 1970. •This model uses the concept of a Mathematical relation

Slide

1-1

Data Models

SOURCE: Fundamentals of Database Systems (6th Edition) by Ramez Elmasi, Shamkant B. Navathe + Database System Concepts (English) 6th Edition by Abraham Silberschatz , S. Sudarshan , Henry F. Korth + Freely Accessible Web Resources

Professor:Mohammad Ubaidullah Bokhari

Page 2: Data Models - amu.ac.in · Relational Data Model •Relational model was first introduced by Ted Codd of IBM Research in 1970. •This model uses the concept of a Mathematical relation

Data Abstraction

• Data Abstraction-

▫ refers to the suppression of details of data organization and storage,

▫ highlighting of the essential features for an improved understanding of data.

▫ There are many approaches to achieve this.

▫ They are called data models.

Page 3: Data Models - amu.ac.in · Relational Data Model •Relational model was first introduced by Ted Codd of IBM Research in 1970. •This model uses the concept of a Mathematical relation

Data Model

• Data Model: A set of concepts to describe the structure of a database, and certain constraints that the database should obey.

• Data Model can be categorized as follow:

▫ Conceptual (High Level) Data Model.

▫ Representational (Implementation) Data Model.

▫ Physical (Low Level) Data Model.

Page 4: Data Models - amu.ac.in · Relational Data Model •Relational model was first introduced by Ted Codd of IBM Research in 1970. •This model uses the concept of a Mathematical relation

The three models

Slide 2-4

Page 5: Data Models - amu.ac.in · Relational Data Model •Relational model was first introduced by Ted Codd of IBM Research in 1970. •This model uses the concept of a Mathematical relation

The three models

Slide 2-5

Page 6: Data Models - amu.ac.in · Relational Data Model •Relational model was first introduced by Ted Codd of IBM Research in 1970. •This model uses the concept of a Mathematical relation

High level Model

This is the highest level in data abstraction.

Provides the concept that are close to the way many user perceive the data.

At this level users see the data in the form of rows and columns.

Slide 2-6

Page 7: Data Models - amu.ac.in · Relational Data Model •Relational model was first introduced by Ted Codd of IBM Research in 1970. •This model uses the concept of a Mathematical relation

Low level Model This is the lowest level in data abstraction

This level describes how the data is actually stored in the physical memory like magnetic tapes, hard disks etc.

In this level the file organization methods like hashing, sequential, B+ tree comes into picture.

This type of concepts are generally meant for computer hardware specialist.

Slide 2-7

Page 8: Data Models - amu.ac.in · Relational Data Model •Relational model was first introduced by Ted Codd of IBM Research in 1970. •This model uses the concept of a Mathematical relation

Representational Data Model

• This is the middle level of abstraction.

• describes what data are stored in the database, and what relationships exist among those data.

• Defines the relationships among tables.

• Types of representational model

Hierarchical model

Network model

Relational data model

Others

Slide 2-8

Page 9: Data Models - amu.ac.in · Relational Data Model •Relational model was first introduced by Ted Codd of IBM Research in 1970. •This model uses the concept of a Mathematical relation

Hierarchical Model • A hierarchical database consists of a collection of records

which are connected to one another through links.

• A link is an association between precisely two records.

• The structure of a hierarchical database consists of

▫ boxes, which correspond to record types

▫ lines, which correspond to links

Page 10: Data Models - amu.ac.in · Relational Data Model •Relational model was first introduced by Ted Codd of IBM Research in 1970. •This model uses the concept of a Mathematical relation

Hierarchical Model Example

Page 11: Data Models - amu.ac.in · Relational Data Model •Relational model was first introduced by Ted Codd of IBM Research in 1970. •This model uses the concept of a Mathematical relation

Evaluation

• Advantages-

▫ The model allows easy addition and deletion of new information.

▫ Data at the top of the Hierarchy is very fast to access.

▫ works through a one to many relationship.

• Disadvantages-

▫ No m:n relationships

▫ Slow retrieval of data stored at leaf nodes.

▫ Navigational and procedural nature of processing (you cant jump on an information, you have to start from root).

Slide 2-11

Page 12: Data Models - amu.ac.in · Relational Data Model •Relational model was first introduced by Ted Codd of IBM Research in 1970. •This model uses the concept of a Mathematical relation

Evaluation • The content of a particular record may be replicated in several

different locations

• For example in banking system an account may belong to different customer, in this case account information would be replicated at different location.

• Record replication has two major issues:

▫ Updating of record may result in Data inconsistency

▫ Waste of space

Slide 2-12

Page 13: Data Models - amu.ac.in · Relational Data Model •Relational model was first introduced by Ted Codd of IBM Research in 1970. •This model uses the concept of a Mathematical relation

Network Model • Hierarchical database model structures data as a tree of

records, with each record having one parent record and many children while, the network model allows each record to have multiple parent and child records, forming a generalized graph structure.

• A network database consists of a collection of records connected to one another through links.

• The network model differs from the hierarchical model in that the records are organized as graph rather than a tree.

• The structure of a Network database consists of

▫ boxes, which correspond to record types

▫ lines, which correspond to links

Page 14: Data Models - amu.ac.in · Relational Data Model •Relational model was first introduced by Ted Codd of IBM Research in 1970. •This model uses the concept of a Mathematical relation

Network Model Example

Slide 2-14

Page 15: Data Models - amu.ac.in · Relational Data Model •Relational model was first introduced by Ted Codd of IBM Research in 1970. •This model uses the concept of a Mathematical relation

Evaluation

• Advantages-

▫ Faster access to leaf records.

▫ works through a many to many relationship.

• Disadvantages-

▫ Deletion becomes difficult.

▫ Much more complex than the hierarchical model.

▫ Nobody really gave attention to Network models. It did not have many problems. But soon a more flexible and easy to understand structure (relational model).

Slide 2-15

Page 16: Data Models - amu.ac.in · Relational Data Model •Relational model was first introduced by Ted Codd of IBM Research in 1970. •This model uses the concept of a Mathematical relation

Relational Data Model

• Relational model was first introduced by Ted Codd of IBM Research in 1970.

• This model uses the concept of a Mathematical relation as its building block.

• It has its theoretical basis primarily in set theory.

• In relational model, database are represented as a collection of relations. Relation resembles as table of values where each row in the table represented as collection of related data values.

• Each row in the table is called tuple and each column is called attribute.

Slide 2-16

Page 17: Data Models - amu.ac.in · Relational Data Model •Relational model was first introduced by Ted Codd of IBM Research in 1970. •This model uses the concept of a Mathematical relation

Example

Slide 2-17

Page 18: Data Models - amu.ac.in · Relational Data Model •Relational model was first introduced by Ted Codd of IBM Research in 1970. •This model uses the concept of a Mathematical relation

Evaluation

• Advantages:

▫ Most of what we are looking for.

▫ Very efficient in complex query situations.

▫ Very neat foundation mathematics.

▫ Use simple structures such as tables.

• Disadvantages:

▫ Not suitable where relationships are not clearly defined.

▫ Not much flexibility in creating new data types and methods.

▫ Not suitable for complex data and/or complex data relationships.

Slide 2-18

Page 19: Data Models - amu.ac.in · Relational Data Model •Relational model was first introduced by Ted Codd of IBM Research in 1970. •This model uses the concept of a Mathematical relation

Object Oriented Data model • Data models such as relational, network, and hierarchical, have

been quite successful in developing the database technologies for many business database applications.

• However, Relational, Network and Hierarchical models have certain shortcomings to design complex database applications such as databases for engineering design and manufacturing (CAD/CAM), scientific experiments, telecommunications, geographic information systems, and multimedia.

• Object oriented databases have been proposed to meet some of the needs of these more complex database applications.

• An object database (also object-oriented database management system) is a database management system in which information is represented in the form of objects as used in object-oriented programming.

Slide 2-19

Page 20: Data Models - amu.ac.in · Relational Data Model •Relational model was first introduced by Ted Codd of IBM Research in 1970. •This model uses the concept of a Mathematical relation

Object Oriented Data model(cont..)

• Object databases provide the designer to specify both the structure of complex objects as well as operations that can be applied to these objects.

• Object databases are designed in such a way that they can be directly integrated with software developed using object-oriented programming languages.

• OO database extend the existence of objects so that they are stored permanently in a database, and hence the objects become persistent objects.

Slide 2-20

Page 21: Data Models - amu.ac.in · Relational Data Model •Relational model was first introduced by Ted Codd of IBM Research in 1970. •This model uses the concept of a Mathematical relation

Example

Slide

2-21

Page 22: Data Models - amu.ac.in · Relational Data Model •Relational model was first introduced by Ted Codd of IBM Research in 1970. •This model uses the concept of a Mathematical relation

Evaluation • Advantages:

▫ Designer can specify the structure of objects and their behavior (methods).

▫ Better interaction with object-oriented languages such as Java and C++

▫ Definition of complex and user-defined types

▫ Encapsulation of operations and user-defined methods.

• Disadvantages:

▫ Query processing is not effective.

▫ No well-defined underlying mathematics.

▫ No well-accepted standards.

▫ Relatively new.

▫ Uses complex structures.

▫ Only useful when relational model can’t be used.

Slide

2-22

Page 23: Data Models - amu.ac.in · Relational Data Model •Relational model was first introduced by Ted Codd of IBM Research in 1970. •This model uses the concept of a Mathematical relation

Object v/s Relational Models

Slide

2-23

Page 24: Data Models - amu.ac.in · Relational Data Model •Relational model was first introduced by Ted Codd of IBM Research in 1970. •This model uses the concept of a Mathematical relation

Object-Relational Model

• The relational model with object database enhancements is sometimes referred to as the object-relational model.

• Some object oriented features have been added in SQL-99 such as

▫ Inheritance mechanism have been added

▫ Facility of defining new data types and methods.

Slide

2-24