Data Modelling and Data Models MODULE 2
Data Modelling and Data Models MODULE 2
DEFINITION:
DATA MODELLING:
2:
may:
1. create a database that omits data required to create
critical reports,
2. produces results that are incorrect or inconsistent,
and is
3. unable to accommodate changes in user’s
requirements
DATA MODEL BASIC
BUILDING BLOCKS
The basic building blocks of all data
models are entities, attributes,
relationships, and constraints.
Entities are the principal data object about
which information is to be collected. Entities
are usually recognizable concepts, either
concrete or abstract, such as person, places,
Entities things, or events which have relevance to the
(tables) database.
Some specific examples of entities are:
noun EMPLOYEES
PROJECTS
CUSTOMER PURCHASE ORDER
ORGANIZATION CUSTOMER ORDER
PRODUCT
INVOICES
An attribute is a characteristic of an entity. For
example, a CUSTOMER entity would be
described by attributes such as customer last
name, customer first name, customer phone,
customer address, and customer credit limit.
Attributes Attributes are the equivalent of fields in file
(columns) systems.
A painter paints many different paintings, but each one of them is painted by only one
painter. Thus, the painter (the “one”) is related to the paintings (the “many”).
Similarly, a customer (the “one”) may generate many invoices, but each invoice (the
“many”) is generated by only a single customer.
The “CUSTOMER generates INVOICE” relationship would also be labeled 1:M.
Many-to-many (M:M or *..*) relationship.
An employee may learn many job skills, and each job skill may be learned by many
employees.
Similarly, a student can take many classes and each class can be taken by many students,
thus yielding the M:M relationship label or the relationship expressed by “STUDENT
takes CLASS.”
One-to-one (1:1 or 1..1) relationship.
A retail company’s management structure may require that each of its stores be managed
by a single employee.
In turn, each store manager, who is an employee, manages only a single store.
The main sources of business rules are company managers, policy makers,
department managers, and written documentation such as a company’s
procedures, standards, or operations manuals. A faster and more direct
source of business rules is direct interviews with end users.
Translating Business Rules into Data Model Components
Business rules set the stage for the proper identification of entities, attributes,
relationships, and constraints. In the real world, names are used to identify objects. If
the business environment wants to keep track of the objects, there will be specific
business rules for them.
A noun in a business rule will translate into an entity in the model, and
A verb (active or passive) associating nouns will translate into a relationship
among the entities.
“a customer may generate many invoices”
The network model was created to represent complex data relationships more
effectively than the hierarchical model, to improve database performance, and to
impose a database standard.
In the network model, the user perceives the network database as a collection of
records in 1:M relationships. However, unlike the hierarchical model, the network
model allows a record to have more than one parent.
A set represents a 1:M relationship between the owner and the member.
The Relational Model
The relational model was introduced in 1970 by E. F. Codd (of IBM) in his landmark paper
“A Relational Model of Data for Large Shared Databanks” ( Communications of the ACM,
June 1970, pp. 377−387). The relational model represented a major breakthrough for both
users and designers.
The relationship type (1:1, 1:M, or M:N) is often shown in a relational schema, an example
of which is shown in Figure 2.4.
The relational data model and ERM combined to provide the foundation for tightly structured
database design. ER models are normally represented in an entity relationship diagram
(ERD), which uses graphical representations to model database components.