Data Model
Data Model
information system
Data Model
Chapter 8
Data Models
• Data Model:
• A set of concepts to describe the structure of a database, the operations for
manipulating these structures, and certain constraints that the database should
obey.
• Data Model Structure and Constraints:
• Constructs are used to define the database structure
• Constructs typically include elements (and their data types) as well as groups of
elements (e.g. entity, record, table), and relationships among such groups
• Constraints specify some restrictions on valid data; these constraints must be
enforced at all times
Data Models
• Data Model Operations:
• These operations are used for specifying database retrievals and updates by
referring to the constructs of the data model.
• Operations on the data model may include basic model operations (e.g.
generic insert, delete, update) and user-defined operations (e.g.
compute_student_gpa, update_inventory)
Categories of Data Models
• Conceptual (high-level) data models:
• Provide concepts that are close to the way many users perceive data.
• (Also called entity-based or object-based data models.)
• Physical (low-level) data models:
• Provide concepts that describe details of how data is stored in the computer.
These are usually specified in an ad-hoc manner through DBMS design and
administration manuals
• Implementation (representational) data models:
• Provide concepts that fall between the above two, used by many commercial
DBMS implementations (e.g. relational data models used in many commercial
systems).
Categories of Data Models
Uses of Data Model
• The entities and concepts are defined by using this model. All the
important entities and relationships are initially find out by using this
model.
• The project scope is defined by a conceptual data model. By defining
the project scope the time scheduling and time management can be
properly managed.
• The conceptual data model is used to get a high-level understanding of
the system throughout the complete software development lifecycle. By
using the conceptual model the business executives and business
managers can understand the system easily and will get a high level of
knowledge about the system.
Uses of Data Model
• Let us see some of the uses of data models which are as follows:
• It is used to represent all the data objects in the database accurately. If any data is
omitted it can create problems while performing database operations.
• The data model helps to represent the data in logical and physical levels. ‘
• The relational tables, foreign and primary keys are all defined by the data models.
• The data redundancy can be eliminated from the database as the data model can easily
identify the redundant data. The data models can also be used to identify the missing
data and can take appropriate actions according to that.
• As the data models help to represent the data virtually the developers use this virtual
representation to create an actual database from that.
• Using the data models while creating the database helps to maintain the database and
helps to upgrade the database with fewer efforts.
What is Conceptual Data Model?
• It is used to provide information about business rules and business
concepts that can be developed by business domain people. This
model is used to define the relationship and the data entities which
are used by the model. The entity can be defined as a real-world
object whereas the relationship is the dependency between any two
entities.
What is Conceptual Data Model?
• As the conceptual data model is of high level it usually not contains
attributes in its structure. This model is used to define the relationship
among the data entities but does not provide information about
cardinality properties. The aim of the conceptual data model is to
define a model that is independent of any database management
system or any database technology. This model is usually constructed
initially which covers the initial requirements and also contains high-
level concepts for defining the business structures.
Components of ER Model:
Data Flow Diagram: Developed By Larry Constantine as a way of expressing system requirements
in graphical Form:
Data Flow Models (DFMs) are easy to understand and, with a little practice, reasonably quick and
straightforward to develop
They consist of two parts: a set of Data Flow Diagrams (DFDs) and a set of associated textual
descriptions
… that provide us with the truly effective tool for understanding the information processes of a
system
Objectives of Data Flow Diagram
successive refinement occurs until the bottom (primitive) levels are defined.
data elements - lowest level of information on which a process can act i.e. DB
attributes/record fields - e.g. unit price.
data stores - places where data are stored; e.g. files; microfiche, filing cabinets.
data flows - represent movement of data in a system; consist of data input and
data output e.g. forms, reports, invoices, letters.
identifies and names the groups of data elements that connect one process to
another.
Process
Data store
Data flow
Data flow diagram of part of an order processing
system
Order
Available stock
Customer
stock
Invoice Process
order
Unfilled order
Out-of-stock backorders
notice
Despatch note
Warehous
e
Data flow diagram of a travel agent booking
system
Customer
Travel-query Available flights
Book flights
flight
Booking
Booking
confirmation
Entity-Relationship Model( ER Model)
23
How to find entities?
• Entity:
• "...anything (people, places, objects, events, etc.) about
which we store information (e.g. supplier, machine tool,
employee, utility pole, airline seat, etc.).”
• Tangible: customer, product
• Intangible: order, accounting receivable
• Look for singular nouns (beginner)
• BUT a proper noun is not a good candidate….
24
Entity Instance
Entity instance: a single occurrence of an entity.
• 6 instances
• Attribute:
• Attributes are data objects that either identify or
describe entities (property of an entity).
• In other words, it is a descriptor whose values are
associated with individual entities of a specific entity type
• The process for identifying attributes is similar except now you
want to look for and extract those names that appear to be
descriptive noun phrases.
26
How to find relationships?
• Relationship:
• Relationships are associations between entities.
• Typically, a relationship is indicated by a verb connecting
two or more entities.
• Employees are assigned to projects
• Relationships should be classified in terms of cardinality.
• One-to-one, one-to-many, etc.
27
How to find cardinalities?
• Cardinality:
• The cardinality is the number of occurrences in one
entity which are associated to the number of occurrences
in another.
• There are three basic cardinalities (degrees of
relationship).
• one-to-one (1:1), one-to-many (1:M), and many-to-many
(M:N)
28
Identifier
29
Entity
• Entity:
• Represented by a rectangle, with its name on the top.
The name is singular (entity) rather than plural
(entities).
30
Attributes
31
Basic Cardinality Type
• 1-to-1 relationship
• 1-to-M relationship
• M-to-N relationship
Basic Cardinality Type
Example Model
34
Example Model
Business Rule Example 1
38
Discovering Business Rules
• Real world example on the class website
• After reviewing and studying the interview and various forms, develop a draft
business rules - does not need to be bi-directional and less precise wording…
• Keep on going until “optimized”
• Then, finalize Business Rules: bi-directional.
Business Rule Example 2
• Entity:
• Movie Star
• Attributes:
• SS#: “123-45-6789” (single-valued)
• Cell Phone: “(661)123-4567, (661)234-5678” (multi-
valued)
• Name: “Harrison Ford” (composite)
• Address: “123 Main Str., LA, CA” (composite)
• Gender: “Female” (simple)
• Age: 24 (derived)
47
Procedure of ERD
• Relatively simple representations of complex real-
world data structures
• Data modeling is iterative process.
• “complete” and “100% error free” model is not
possible!
• Only “Optimized” model is possible….
48
Physical Data Model