Вы находитесь на странице: 1из 6

Data Warehouse Info

What is a data model?


A data model is a diagram that uses test and symbols to represent groupings of
data so that the reader can understand the actual data better.
For example a spreadsheet groups data in columns, there is a column for Last
Name, First Name and so on. A row on a spreadsheet would represent a record, and
each column would represent a data element. A data model takes things this idea a
step further, showing not only the column heading but also how the heading relate
to each other.
Example:
Person's Name

Person's
Title

Company Name

e-mail Address

Web Ad

Mary K. Smith

President

Mary K Smith Global IT


Consulting

mks@maryksmith.co www.m
m
om

Michael W.
Clayton

Attorney

Bronson, Waters & Green Law


Firm

mwclayton@bwglaw.
org

Data - The raw facts that have little meaning unless they have been organized in
some logical manner . The smallest piece of data that can be recognized by the
computer is a single character, such as the letter A, the number 5, or some symbol
as /. A single character requires one byte of computer storage.
Field - A character or group of characters (alphabetic or numeric) that has a
specific meaning. A field might define a telephone number, a birth date, a
customer name, a year-to-date, sales value, and so on.
Record- A logically connected set of one or more fields that describes a person,
place or thing. For example the fields that constitutes a record for a customer
named J.D. Rudd consist of J.D. Rudd's name, address, phone number, date of birth,
credit limit, and unpaid balance.
File- A collection of related records. For example, a file might contain data about
vendors of ROBCOR Company; or a file might contain the records for the students
currently enrolled at Gigantic University.

www.bw

Screen clipping taken: 1/11/2008, 5:46 PM

C_NAME = Customer Name


C_PHONE = Customer Phone
C_ADDRESS=Customer Address
C_ZIP= Customer Zip

A_NAME= Agent Name


A_PHONE= Agent Phone
TP= Insurance Type
AMT=Insurance Policy Amount
REN= Insurance Renewal

Date

Screen clipping taken: 1/11/2008, 6:33 PM

A_NAME= Agent Name


A_PHONE=Agent Phone
Income Tax Paid
A_ADDRESS= Agent Address
Security Paid
ZIP= Address ZIP Code
HIRED= Agent Date of Hire

YTD_PAY= Year-To-Date Pay


YTD_FIT= Year-To-Date Federal
YTD_FICA= Year-To-Date Social
YTD_SLS=Year-To-Date Sales
DEP= Number of Dependents

Process Flow:

Using the proper file terminology shown above , we can identify the file
components shown (above). For example the CUSTOMER file contains 6 records.
Each record is composed of nine fields: C_NAME, C_PHONE, C_ADDRESS, C_ZIP,
A_NAME, A_PHONE, C_ADDRESS, C_ZIP, A_NAME, A_PHONE, TP, AMT and REN.
The six records are stored in a named file CUSTOMER.
In this example using the CUSTOMER file a developer wrote a program that
produced very useful reports for the sales department:

Monthly summaries that showed the types and amount of insurance


sold by each agent.
(Such reports might be used to analyze each agents productivity)

Monthly checks to determine which customers must be contacted for


renewal

Repots that analyzed the ratios of insurance types sold by each agent

Periodic customer contacts contact letters designed to summarize


coverage and to provide various customer relations bonuses.

The Sales Department would represent an entity, the File Management Programs
would represent a particular Data Mart for SALES, within a Data Warehouse. The
CUSTOMER file would be a data extract which is created within the SALES Data
Mart. The CUSTOMER file is then transferred to the File Reports Program, which
is an application (Web-Base) which produces reports of the business unit, this
application would also most likely have data querying capabilities.
A Database Model is a collection of logical constructs used to represent the data
structure and the data relationships found within the database.
Types of Relationships:
(1) One-To-Many Relationships: A painter paints many different paintings,
but each one of them is painted by only that painter. Thus the painter (the
"one") is related to the paintings (the "many"). Therefore, database designers
label the relationship "PAINTER paints PAINTING" as 1:M. Similarly a customer
account (the "one") might contain many invoices (the "many") are related to
only a single customer account. The "CUSTOMER generates INVOICE"
relationship would also be labeled 1:M.
(2) Many-To-Many Relationship: An employee might learn many job skills, and
each job skill might be learned by many employees. Database designers label
the relationship "EMPLOYEE learns SKILL" as M:N. Similarly a student can take
many courses, and each course can be taken by many students, thus yielding
the M:N relationship label for the relationship expressed by "STUDENT takes
COURSE".
(3) One-To-One 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 - only manages a single store. Therefore,


the relationship "EMPLOYEE manages STORE" is labeled 1:1.
Examples:

Screen clipping taken: 1/12/2008, 7:24 PM

Another well established version of the ERD is the "crow's foot model", the label
"Crows Foot" is derived from the three-pronged symbol used to represent the
"many" side of the relationship:
paints
PAINTER

PAINTING

Table Name: CUSTOMER


Primary Key: CUS_NUM
Foreign Key: None

Table Name: INVOICE


Primary Key: INV_NUMBER
Foreign Key: CUS_CODE

Table Name: LINE


Primary Key: INV_NUMBER +LINE_NUMBER
Foreign Key: INV_NUMBER, PROD_CODE

Table Name: PRODUCT


Primary Key: PROD_CODE
Foreign Key: None

Вам также может понравиться