Database Fundamentals- Content Analysis
Chap 2.pptx
Database Principles: Fundamentals of Design, Implementations and Management
CHAPTER 2: DATA MODELS
Database Principles 2nd Ed., Coronel, Morris, Rob & Crockett
© 2013 Cengage Learning EMEA
20/03/2017
1
In this chapter, you will learn:
Why data models are important
About the basic data-modeling building blocks
What business rules are and how they influence database design
How the major data models evolved
How data models can be classified by level of abstraction
Database Principles 2nd Ed., Coronel, Morris, Rob & Crockett
© 2013 Cengage Learning EMEA
2
20/03/2017
The Importance of Data Models
Data models
Relatively simple representations, usually graphical, of complex real-world data structures
Facilitate interaction among the designer, the applications programmer, and the end user
End-users have different views and needs for data
Data model organizes data for various users
Database Principles 2nd Ed., Coronel, Morris, Rob & Crockett
© 2013 Cengage Learning EMEA
3
20/03/2017
Data Model Basic Building Blocks
Entity - anything about which data are to be collected and stored
Attribute - a characteristic of an entity
Relationship - describes an association among entities
One-to-many (1:*) relationship
Many-to-many (*:*) relationship
One-to-one (1:1) relationship
Constraint - a restriction placed on the data
Database Principles 2nd Ed., Coronel, Morris, Rob & Crockett
© 2013 Cengage Learning EMEA
4
20/03/2017
Business Rules
A business rule is a brief, precise, and unambiguous descriptions of a policies, procedures, or principles within a specific organization
Apply to any organization that stores and uses data to generate information
Description of operations that help to create and enforce actions within that organization’s environment
Must be rendered in writing
Must be kept up to date
Sometimes are external to the organization
Must be easy to understand and widely disseminated
Describe characteristics of the data as viewed by the company
Database Principles 2nd Ed., Coronel, Morris, Rob & Crockett
© 2013 Cengage Learning EMEA
5
20/03/2017
Discovering Business Rules
Sources of Business Rules:
Company managers
Policy makers
Department managers
Written documentation
Procedures
Standards
Operations manuals
Direct interviews with end users
Database Principles 2nd Ed., Coronel, Morris, Rob & Crockett
© 2013 Cengage Learning EMEA
6
20/03/2017
Translating Business Rules into Data Model Components
Standardize company’s view of data
Constitute a communications tool between users and designers
Allow designer to understand the nature, role, and scope of data
Allow designer to understand business processes
Allow designer to develop appropriate relationship participation rules and constraints
Promote creation of an accurate data model
Generally, nouns translate into entities
Verbs translate into relationships among entities
Relationships are bi-directional
Database Principles 2nd Ed., Coronel, Morris, Rob & Crockett
© 2013 Cengage Learning EMEA
7
20/03/2017
The Evolution of Data Models
Database Principles 2nd Ed., Coronel, Morris, Rob & Crockett
© 2013 Cengage Learning EMEA
8
20/03/2017
The Evolution of Data Models (cont..)
Hierarchical
Network
Relational
Entity relationship
Object oriented (OO)
Database Principles 2nd Ed., Coronel, Morris, Rob & Crockett
© 2013 Cengage Learning EMEA
9
20/03/2017
The 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”
The hierarchical structure contains levels, or segments
Depicts a set of one-to-many (1:*) relationships between a parent and its children segments
Each parent can have many children
each child has only one parent
Database Principles 2nd Ed., Coronel, Morris, Rob & Crockett
© 2013 Cengage Learning EMEA
10
20/03/2017
The Hierarchical Model (cont…)
Advantages
Many of the hierarchical data model’s features formed the foundation for current data models
Its database application advantages are replicated, though in a different form, in current database environments
Generated a large installed (mainframe) base, created a pool of programmers who developed numerous tried-and-true business applications
Database Principles 2nd Ed., Coronel, Morris, Rob & Crockett
© 2013 Cengage Learning EMEA
11
Albeit= Bien que , quoique que , though
20/03/2017
The Hierarchical Model (cont..)
Disadvantages
Complex to implement
Difficult to manage
Lacks structural independence
Implementation limitations
Lack of standards
Database Principles 2nd Ed., Coronel, Morris, Rob & Crockett
© 2013 Cengage Learning EMEA
12
20/03/2017
The Network Model
Created to
Represent complex data relationships more effectively than the hierarchical model
Improve database performance
Impose a database standard
While the Network model is not used today, the definitions of standard database concepts are still used by modern data models such as:
Schema
Conceptual organization of entire database as viewed by the database administrator
Database Principles 2nd Ed., Coronel, Morris, Rob & Crockett
© 2013 Cengage Learning EMEA
13
20/03/2017
The Network Model (cont..)
Subschema
Defines database portion “seen” by the application programs that actually produce the desired information from data contained within the database
Data Management Language (DML)
Defines the environment in which data can be managed and is used to work with the data in the database
Schema Data Definition Language (DDL)
Enables database administrator to define schema components
Database Principles 2nd Ed., Coronel, Morris, Rob & Crockett
© 2013 Cengage Learning EMEA
14
20/03/2017
The Network Model (cont..)
Disadvantages
Too cumbersome
The lack of ad hoc query capability put heavy pressure on programmers
Any structural change in the database could produce havoc in all application programs that drew data from the database
Many database old-timers can recall the interminable information delays
Database Principles 2nd Ed., Coronel, Morris, Rob & Crockett
© 2013 Cengage Learning EMEA
15
20/03/2017
The Relational Model
Developed by Codd (IBM) in 1970
Considered ingenious but impractical in 1970
Conceptually simple
Computers lacked power to implement the relational model
Today, microcomputers can run sophisticated Relational Database Software called Relational Database Management System (RDBMS)- Ex: Oracle : mainframe relational software
Performs same basic functions provided by hierarchical and network DBMS systems, in addition to a host of other functions
Most important advantage of the RDBMS is its ability to hide the complexities of the relational model from the user
Database Principles 2nd Ed., Coronel, Morris, Rob & Crockett
© 2013 Cengage Learning EMEA
16
20/03/2017
The Relational Model (cont..)
Table
Matrix consisting of a series of row/column intersections
Related to each other through sharing a common entity characteristic
Tables, also called relations are related to each other through the sharing of a common field
Relational diagram
Is a representation of relational database’s entities, attributes within those entities, and relationships between those entities
Database Principles 2nd Ed., Coronel, Morris, Rob & Crockett
© 2013 Cengage Learning EMEA
17
20/03/2017
The Relational Model (cont..)
Relational Table
Stores a collection of related entities
Resembles a file
Relational table is purely a logical structure
How data are physically stored in the database is of no concern to the user or the designer
This property became the source of a real database revolution
Database Principles 2nd Ed., Coronel, Morris, Rob & Crockett
© 2013 Cengage Learning EMEA
18
20/03/2017
The Relational Model (cont..)
Database Principles 2nd Ed., Coronel, Morris, Rob & Crockett
© 2013 Cengage Learning EMEA
19
20/03/2017
The Relational Model (continued)
Database Principles 2nd Ed., Coronel, Morris, Rob & Crockett
© 2013 Cengage Learning EMEA
20
20/03/2017
The Relational Model (cont..)
Another raison for the database model’s rise to dominance is its powerful and flexible query language
Structured Query Language (SQL) allows the user to specify what must be done without specifying how it must be done
SQL-based relational database application involves 3 parts:
User interface
A set of tables stored in the database
SQL engine
Database Principles 2nd Ed., Coronel, Morris, Rob & Crockett
© 2013 Cengage Learning EMEA
21
20/03/2017
The Entity Relationship Model
Widely accepted and adapted graphical tool for data modeling
Introduced by Peter Chen in 1976
It was the graphical representation of entities and their relationships in a database structure.
More recently the class diagram component of the Unified Modeling Language (UML) has been used to produce entity relationship models.
Database Principles 2nd Ed., Coronel, Morris, Rob & Crockett
© 2013 Cengage Learning EMEA
22
20/03/2017
The Entity Relationship Model (cont..)
Entity relationship diagram (ERD)
Uses graphic representations to model database components
Entity is mapped to a relational table
Entity instance (or occurrence) is a row in table
Each entity is described by a set of attributes that describe particular characteristics of the entity
Entity set is collection of like entities
Connectivity labels types of relationships (1-1, 1- M, M-M)
Database Principles 2nd Ed., Coronel, Morris, Rob & Crockett
© 2013 Cengage Learning EMEA
23
20/03/2017
The Entity Relationship Model (cont..)
Database Principles 2nd Ed., Coronel, Morris, Rob & Crockett
© 2013 Cengage Learning EMEA
24
20/03/2017
The Entity Relationship Model (cont..)
Fig 2.4 The basic Crow’s foot ERD
Database Principles 2nd Ed., Coronel, Morris, Rob & Crockett
© 2013 Cengage Learning EMEA
25
20/03/2017
Data Models: A Summary
Each new data model capitalized on the shortcomings of previous models
Common characteristics that data models must have in order to be widely accepted:
Conceptual simplicity without compromising the semantic completeness of the database
Represent the real world as closely as possible
Representation of real-world transformations (behavior) must comply with consistency and integrity characteristics of any data model
Database Principles 2nd Ed., Coronel, Morris, Rob & Crockett
© 2013 Cengage Learning EMEA
26
20/03/2017
Data Models: A Summary (cont..)
Database Principles 2nd Ed., Coronel, Morris, Rob & Crockett
© 2013 Cengage Learning EMEA
27
20/03/2017
Degrees of Data Abstraction
Way of classifying data models
Many processes begin at high level of abstraction and proceed to an ever-increasing level of detail
Designing a usable database follows the same basic process
Database Principles 2nd Ed., Coronel, Morris, Rob & Crockett
© 2013 Cengage Learning EMEA
28
20/03/2017
Degrees of Data Abstraction (cont..)
In the early 1970s, the American National Standards Institute (ANSI) Standards Planning and Requirements Committee (SPARC)
Defined a framework for data modeling based on degrees of data abstraction:
External
Conceptual
Internal
Database Principles 2nd Ed., Coronel, Morris, Rob & Crockett
© 2013 Cengage Learning EMEA
29
20/03/2017
Degrees of Data Abstraction (cont..)
Database Principles 2nd Ed., Coronel, Morris, Rob & Crockett
© 2013 Cengage Learning EMEA
30
20/03/2017
The External Model
End users’ view of the data environment
Requires that the modeler subdivide set of requirements and constraints into functional modules that can be examined within the framework of their external models
Advantages:
Easy to identify specific data required to support each business unit’s operations
Facilitates designer’s job by providing feedback about the model’s adequacy
Creation of external models helps to ensure security constraints in the database design
Simplifies application program development
Database Principles 2nd Ed., Coronel, Morris, Rob & Crockett
© 2013 Cengage Learning EMEA
31
20/03/2017
The External Model (cont..)
Fig 2.9 External Models for Tiny College
Database Principles 2nd Ed., Coronel, Morris, Rob & Crockett
© 2013 Cengage Learning EMEA
32
20/03/2017
The External Model (cont..)
Fig 2.9 External Models for Tiny College
Database Principles 2nd Ed., Coronel, Morris, Rob & Crockett
© 2013 Cengage Learning EMEA
33
20/03/2017
The Conceptual Model
Represents global view of the entire database
Representation of data as viewed by the entire organization
The conceptual is the basis for identification and high-level description of main data objects, avoiding details
Most widely used conceptual model is the entity relationship (ER) model
Database Principles 2nd Ed., Coronel, Morris, Rob & Crockett
© 2013 Cengage Learning EMEA
34
20/03/2017
The Conceptual Model (cont..)
Fig 2.10 The Conceptual Model for Tiny College
Database Principles 2nd Ed., Coronel, Morris, Rob & Crockett
© 2013 Cengage Learning EMEA
35
20/03/2017
The Conceptual Model (cont..)
First, the CM provides a relatively easily understood macro level view of data environment
Second, the CM is 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
Database Principles 2nd Ed., Coronel, Morris, Rob & Crockett
© 2013 Cengage Learning EMEA
36
20/03/2017
The Internal Model
Is the representation of the database as “seen” by the DBMS
The internal model should map the conceptual model to the DBMS
The internal schema depicts a specific representation of an internal model
Database Principles 2nd Ed., Coronel, Morris, Rob & Crockett
© 2013 Cengage Learning EMEA
37
20/03/2017
Fig 2.11 An Internal Model for Tiny College
Database Principles 2nd Ed., Coronel, Morris, Rob & Crockett
© 2013 Cengage Learning EMEA
38
20/03/2017
The Physical Model
Operates at lowest level of abstraction, describing the way data are saved on storage media such as disks or tapes
Software and hardware dependent
Requires that database designers have a detailed knowledge of the hardware and software used to implement database design
Database Principles 2nd Ed., Coronel, Morris, Rob & Crockett
© 2013 Cengage Learning EMEA
39
20/03/2017
The Physical Model (cont..)
Database Principles 2nd Ed., Coronel, Morris, Rob & Crockett
© 2013 Cengage Learning EMEA
40
20/03/2017
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
Database Principles 2nd Ed., Coronel, Morris, Rob & Crockett
© 2013 Cengage Learning EMEA
41
20/03/2017
Summary (cont..)
Hierarchical model
Depicts a set of one-to-many (1:*) relationships between a parent and its children segments
Network data model
Uses sets to represent 1:* 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
Database Principles 2nd Ed., Coronel, Morris, Rob & Crockett
© 2013 Cengage Learning EMEA
42
20/03/2017
Summary (cont..)
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
NoSQL databases are a new generation of databases that do not use the relational model and are geared to support the very specific needs of Big Data organizations
Additional slides are next
Database Principles 2nd Ed., Coronel, Morris, Rob & Crockett
© 2013 Cengage Learning EMEA
43
20/03/2017
The Object Oriented Model
Modeled both data and their relationships in a single structure known as an object
Object-oriented data model (OODM) is the basis for the object-oriented database management system (OODBMS)
OODM is said to be a semantic data model
Database Principles 2nd Ed., Coronel, Morris, Rob & Crockett
© 2013 Cengage Learning EMEA
44
20/03/2017
The Object Oriented Model (cont..)
Object described by its factual content
Like relational model’s entity
Includes information about relationships between facts within object, and relationships with other objects
Unlike relational model’s entity
Subsequent OODM development allowed an object to also contain all operations
Object becomes basic building block for autonomous structures
Database Principles 2nd Ed., Coronel, Morris, Rob & Crockett
© 2013 Cengage Learning EMEA
45
20/03/2017
The Object Oriented Model (cont..)
Object is an abstraction of a real-world entity
Attributes describe the properties of an object
Objects that share similar characteristics are grouped in classes
Classes are organized in a class hierarchy
Inheritance is the ability of an object within the class hierarchy to inherit the attributes and methods of classes above it
Database Principles 2nd Ed., Coronel, Morris, Rob & Crockett
© 2013 Cengage Learning EMEA
46
20/03/2017
The Object Oriented Model (cont..)
Fig 2.5 A comparison of the OO model and the ER model
Database Principles 2nd Ed., Coronel, Morris, Rob & Crockett
© 2013 Cengage Learning EMEA
47
20/03/2017
Other Models
Extended Relational Data Model (ERDM)
Semantic data model developed in response to increasing complexity of applications
DBMS based on the ERDM often described as an object/relational database management system (O/RDBMS)
Primarily geared to business applications
Database Principles 2nd Ed., Coronel, Morris, Rob & Crockett
© 2013 Cengage Learning EMEA
48
20/03/2017
Emerging Data Models: Big Data and NoSQL
Big Data refers to a movement to find new and better ways to manage large amounts of Web-generated data and derive business insight from it, while simultaneously providing high performance and scalability at a reasonable cost.
Database Principles 2nd Ed., Coronel, Morris, Rob & Crockett
© 2013 Cengage Learning EMEA
Emerging Data Models: Big Data and NoSQL (cont…)
The relational approach does not always match the needs of organizations with Big Data challenges.
It is not always possible to fi t unstructured, social media data into the conventional relational structure of rows and columns.
Adding millions of rows of multi-format (structured and nonstructured) data on a daily basis will
inevitably lead to the need for more storage, processing power, and sophisticated data analysis
tools that may not be available in the relational environment.
The type of high-volume implementations required in the RDBMS environment
for the Big Data problem comes with a hefty price tag for expanding hardware, storage, and software licenses.
Data analysis based on OLAP tools has proven to be very successful in relational environments with highly structured data.
Database Principles 2nd Ed., Coronel, Morris, Rob & Crockett
© 2013 Cengage Learning EMEA
Database Models and the Internet
Internet drastically changed role and scope of database market
OODM and ERDM-O/RDM have taken a backseat to development of databases that interface with Internet
Dominance of Web has resulted in growing need to manage unstructured information
Database Principles 2nd Ed., Coronel, Morris, Rob & Crockett
© 2013 Cengage Learning EMEA
51
20/03/2017
NoSQL Databases
NoSQL to refer to a new generation of databases that address the specific challenges of the Big Data era.
They have the following general characteristics:
Not based on the relational model, hence the name NoSQL.
Supports distributed database architectures.
Provides high scalability, high availability, and fault tolerance.
Supports very large amounts of sparse data.
Geared toward performance rather than transaction consistency.
Database Principles 2nd Ed., Coronel, Morris, Rob & Crockett
© 2013 Cengage Learning EMEA
NoSQL Databases (cont..)
The key-value data model is based on a structure composed of two data elements: a key and a value, in which every key has a corresponding value or set of values.
The key-value data model is also referred to as the attribute-value or associative data model.
Database Principles 2nd Ed., Coronel, Morris, Rob & Crockett
© 2013 Cengage Learning EMEA
NoSQL Databases (cont…)
Database Principles 2nd Ed., Coronel, Morris, Rob & Crockett
© 2013 Cengage Learning EMEA
NoSQL Databases (cont..)
The data type of the “value” column is generally a long string to accommodate the variety of actual data types of the values placed in the column.
To add a new entity attribute in the relational model, you need to modify the table definition.
To add a new attribute in the key-value store, you add a row to the key-value store, which is why it is said to be “schema-less.”
NoSQL databases do not store or enforce relationships among entities.
Database Principles 2nd Ed., Coronel, Morris, Rob & Crockett
© 2013 Cengage Learning EMEA
NoSQL Databases (cont..)
NoSQL databases use their own native application programming interface (API) with simple data access commands, such as put, read, and delete.
Indexing and searches can be difficult. Because the “value” column in the key-value data model could contain many different data types, it is often difficult to create indexes on the data. At the same time, searches can become very complex.
Database Principles 2nd Ed., Coronel, Morris, Rob & Crockett
© 2013 Cengage Learning EMEA