100% found this document useful (1 vote)
90 views

Chapter 2 Data Model

The document discusses different types of data models including hierarchical, network, relational, entity-relationship, object-oriented models. It explains the basic concepts, advantages and disadvantages of each model. The document also talks about different components of a data model like entities, attributes, relationships and constraints.

Uploaded by

imannurumairah
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
90 views

Chapter 2 Data Model

The document discusses different types of data models including hierarchical, network, relational, entity-relationship, object-oriented models. It explains the basic concepts, advantages and disadvantages of each model. The document also talks about different components of a data model like entities, attributes, relationships and constraints.

Uploaded by

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

ICT200

INTRODUCTION TO DATABASE
MANAGEMENT SYSTEM

By :
Miss Noorfadzilah Arifin

Chapter 2 Data Model


The Importance of Data Model

An abstraction of a more complex real world object /


Model event

Data Model Simple / graphical representation of complex real


data structures

Main functions of model

to help us to understand the complexities of the real world


environment.
as a communication tools to facilitates the interaction among
designer, programmer & user.
The Importance of Data Model

Data Model Represent What ??

Data structures
Their characteristic
Relations
Constraints
Transformation
Data Model Basic Building Blocks

Constraints
Entity Attribute Relationship
Is a restriction
Describe an placed on the data
Is anything / or any Is a characteristic of
real world object that an entity association among
can store data entities
Eg:
• Book Price must less than
Eg:
Eg: Eg: rm1000
Book_Title, • Student CGPA must between
Book, Doctor, 1:1, 1:M, 0.00 and 4.00
Doc_Id,
Student, M:N • Each Doctor must have at
Student_Name
least 2 specialization
Types of Relationship

 1:1 (one-to-one)
has
LECTURER ROOM

 1:M (one-to-many)
has
PERSON CAR

 M:N (many-to-many)
served
NURSE WARD
Business Rules

 Is a brief, precise & unambiguous description of a


policy / procedure / within a specific organization
environment.

 Is derived from a detailed description of an


organization’s operation

 To define entity, attributes, relationship, constraint

 Must be written / documented properly and


updated to reflect any change in the organization’s
operational environment
Business Rules

 Examples of business rules are as follow:


✓ A customer may generate many invoices

✓ An invoice is generated by only one customer

✓ A training session cannot be scheduled for fewer than 10


employees or more than 30 employees

 Those business rules establish entities, relationship


and constrains.
 But not all business rules can be modeled. Ex: “no pilot
can fly more than 10 hours within any 24 hours period”
– can be enforced by application software
Business Rules

WHERE TO GET THE BR ??????

➢ Company manager

➢ Department manager

➢ Policy makers

➢ Written document

➢ company procedures

➢ Standard & policy

➢ operation manual

➢ End user
Business Rules

Why BR need to be identified & documented properly???

 Help to standardize the company’s view of data


 As a comm. tools between user & designers
 Allow the designer to understand the nature, role,
and scope of data
 To understand the business process
 To develop appropriate relationship participation
rules & constraints and to create an accurate data
model
Discovering Business Rules

❑ Generally, nouns translate into entities


❑ Verbs translate into relationships among entities
❑ Relationships are bi-directional
❑ Two questions to identify the relationship type:
✓ How many instances of B are related to one instance of A?

✓ How many instances of A are related to one instance of B?

❑ For example, relationship between student and class by


asking two questions :
✓ How many classes can one student enroll in ? – many classes

✓ How many students can enroll in one class ? – many students


The Evolution of Data Model
Hierarchical Model

 Developed in the 1960s to manage large amounts


of data for complex manufacturing projects

 Basic logical structure is represented by an upside-


down “tree”

 Hierarchical structure contains levels or segments

✓ Segment analogous to a record type

✓ Set of one-to-many relationships between segments


Hierarchical Model
Hierarchical Model

 Disadvantages of the hierarchical model:


✓ Complex to implement

✓ Difficult to manage

✓ Lacks structural independence

✓ Many common data relationships do not conform


1:M form

✓ No standards for how to implement


Network Model

 Created to represent complex data relationships more


effectively
✓ Improves database performance
✓ Imposes a database standard
 Conference on Data Systems Languages (CODASYL)
created the DBTG
 Database Task Group (DBTG): defined environment to
facilitate database creation
Network Model

 Schema

✓ Conceptual organization of entire database as viewed by the


database administrator

 Subschema

✓ Database portion “seen” by the application programs

 Data management language (DML)

✓ Defines the environment in which data can be managed


Network Model

 Resembles hierarchical model


✓ Record may have more than one parent

 User perceives as a collection of records in 1:M


relationships but allows a record to have more than
one parent
 A relationship is called set
 Set composed of two record types
✓ Owner - Equivalent to the hierarchical model’s parent

✓ Member - Equivalent to the hierarchical model’s child


Network Model
Network Model

 Disadvantages of the network model


✓ Cumbersome
✓ Lack of ad hoc query capability placed burden on
programmers to generate code for reports
✓ Structural change in the database could produce
havoc in all application programs
Relational Model

 Implemented through relational database management


system (RDBMS)
✓ Performs same functions provided by hierarchical model
✓ Easier to understand and implement
✓ Hides complexity from the user (collection of tables in which
data are stored and can manipulate and query data)
 Relational diagram (table)
✓ Representation of entities, attributes, and relationships
 Relational table stores collection of related entities
Relational Model
Relational Model

 Rise to dominance because its powerful and flexible


query language – uses Structured Query Language
(SQL)
 The RDMS uses SQL to translate user queries into
instruction for retrieving the requested data
 SQL-based relational database application involves
three parts:
✓ User interface - allows end user to interact with the data

✓ Set of tables stored in the database - each table is


independent from another

✓ SQL “engine” - executes all queries


Entity-Relationship Model

 Widely accepted standard for data modeling

 Graphical representation of entities and their relationships in


a database structure

 Entity relationship diagram (ERD)


✓ Uses graphic representations to model database components

✓ Entity is mapped to a relational table

 Entity instance (or occurrence) is row in table


 Connectivity labels types of relationships
 Relationships expressed using Chen and Crow’s Foot
notation
Entity-Relationship Model
Object-Oriented Model

 Data and relationships contained in single structure


known as an object
 OODM (object-oriented data model) is the basis for
OODBMS
✓ Semantic data model

 Objects contain operations


 Object is self-contained: a basic building-block for
autonomous structures
 Object is an abstraction of a real-world entity
Object-Oriented Model

 Attributes describe the properties of an object


 Objects that share similar characteristics are grouped in
classes
 Classes are organized in a class hierarchy
 Inheritance: object inherits methods and attributes of
parent class
 UML based on OO concepts that describe diagrams
and symbols
✓ Used to graphically model a system
Object-Oriented Model
Summary of Data Model
Degrees of Data Abstraction

◼ Way of classifying data models


◼ External; Conceptual; Internal; Physical
External Model

 End users’ view of the data environment

 Based on the internal model

 A specific representation of an external view → External Schema

 DBMS dependent, and hardware independent


 Advantages :
 make application program development simpler
 easier to identify specific data required
 providing feedback about the conceptual model’s adequacy
 ensure security constraints in the db design
External Model
Conceptual Model

 Global view of dtbs


 Specific representation of an conceptual model → Conceptual
Schema
 Integrate all external view in a single view
 Representation of data as viewed by high level managers
 The basis for identification & description of the main data
objects, avoiding details
 Most widely use conceptual model is the ER Model-represent by
ERD
 Easily understood –macro view of data environment
Conceptual Model

 Independent of both software and hardware

✓ Does not depend on the DBMS software used to implement


the model

✓ Does not depend on the hardware used in the


implementation of the model

✓ Changes in either hardware or DBMS software have no


effect on the database design at the conceptual level
Conceptual Model
Internal Model

 Representation of the db as seen by the DBMS

 Requires the designer to match the conceptual model’s


characteristics and constraints to those of the selected
implementation model

 Maps the conceptual model to the DBMS (eg: Access)

 Internal schema depicts a specific representation of an


internal model

 It is software dependent, hardware independent


Internal Model
Physical Model

 Operates at the lowest level of abstraction

 Describing the way data are saved on storage

 Requires the definition of both physical storage


device and the access methods to reach the
data within the storage device

 It is both software & hardware dependent


Summary of Data Abstraction
Summary

 A data model is a (relatively) simple abstraction of


a complex real-world data environment
 Basic data modeling components are:
✓ Entities
✓ Attributes
✓ Relationships
✓ Constraints
Summary

 Hierarchical model
✓ Depicts a set of one-to-many (1:M) relationships
between a parent and its children segments

 Network data model


✓ Uses sets to represent 1:M relationships between record
types

 Relational model
✓ Current database implementation standard
✓ ER model is a popular graphical tool for data modeling
that complements the relational model
Summary

 Object is basic modeling structure of object


oriented data model

 The relational model has adopted many object-


oriented extensions to become the extended
relational data model (ERDM)

 Data modeling requirements are a function of


different data views (global vs. local) and level of
data abstraction

You might also like