Ch09 PPT
Ch09 PPT
2
Chapter Objectives (Cont.)
3
Data Design Concepts
Data Structures
◦ A framework for organizing, storing, and
managing data
◦ Consists of files or tables that interact in various
ways
Each file or table contains data about people, places,
things, or events
Mario
and Danica: A Data Design
Example
◦ Mario’s Auto Shop
Mario relies on two file oriented systems, that
store data in separate files that are not connected
The MECHANIC SYSTEM uses the MECHANIC file to
store data about shop employees
FIGURE 9-2 In the example shown
The JOB SYSTEM uses the JOB file to store data here, data about the mechanic, the
about work performed at the shop customer, and the brake job might
be stored in a file-oriented system
◦ Danica’s Auto Shop or in a database system
Uses a database management system (DBMS) with
two separate tables that are joined, so they act like
one large table
In Danica’s SHOP OPERATIONS SYSTEM, the tables
are linked by the Mechanic No field, which is called
a common field because it connects the tables
5
Data Design Concepts (Cont.)
6
Data Design Concepts (Cont.)
7
Data Design Concepts (Cont.)
8
Data Design Concepts (Cont.)
DBMS Advantages
• Scalability - A system can be expanded, modified, or
downsized
• Economy of scale - Database design allows better
utilization of hardware
• Enterprise-wide application - A database
administrator (DBA) assesses overall requirements
and maintains the database for the entire
• Stronger standards - Standards for data names,
formats, and documentation are followed uniformly
throughout the organization
9
Data Design Concepts (Cont.)
DBMS Advantages
• Better security - The DBA ensures that only legitimate
users access the database and different users have
different levels of access
• Data independence - Systems that interact with a
DBMS are relatively independent of how the physical
data is maintained
• That design provides the DBA flexibility to alter
data structures without modifying information
systems that use the data
10
DBMS Components
• Interfaces for Users, Database
Administrators, and Related Systems
• USERS
• Typically work with predefined queries and
switchboard commands, but also use query
languages to access stored data
• DATABASE ADMINISTRATORS
• Concerned with data security and integrity,
preventing unauthorized access, providing
backup and recovery, audit trails,
FIGURE 9-7 In addition to interfaces maintaining the database, and supporting
for users, database administrators, user needs
and related information systems, a • RELATED INFORMATION SYSTEMS
DBMS also has a data manipulation • A DBMS can support several related
language, a schema and information systems that provide input to,
subschemas, and a physical data
and require specific data from, the DBMS
repository
11
DBMS Components (Cont.)
12
Web-Based Data Design
• Overview
• A data manipulation language (DML) controls database
operations, including storing, retrieving, updating, and
deleting data
• Connecting to the Web
• The objective is to connect the database to the Web and
enable data to be viewed and updated
• Middleware - software that integrates different applications
and allows them to exchange data and interpret client
requests in HTML form; then translate the requests into
commands that the database can execute
• Data Security
• Web-based data must be secure, yet easily accessible to
authorized users
13
Web-Based Data Design (Cont.)
14
Web-Based Data Design (Cont.)
FIGURE 9-10 When a client workstation requests a Web page (1), the
Web server uses middleware to generate a data query to the database
server (2). The database server responds (3), and middleware
translates the retrieved data into an HTML page that can be sent by the
Web server and displayed by the user’s browser (4)
15
Data Design Terms
• Definitions:
• ENTITY
• An entity is a person, place, thing, or event for which data
is collected and maintained
• TABLE OR FILE
• A table, or file, contains a set of related records that store
data about a specific entity
• FIELD
• A field, also called an attribute, is a single characteristic
or fact about an entity
• RECORD
• A record, also called a tuple (rhymes with couple), is a set
of related fields that describes one instance, or
occurrence, of an entity, such as one customer, one
order, or one product
16
Data Design Terms (Cont.)
• Key Fields:
• PRIMARY KEY
• A field or combination of fields that uniquely and
minimally identifies a particular member of an entity
• CANDIDATE KEY
• Any field that could serve as a primary key is called a
candidate key
• FOREIGN KEY
• A common field that exists in more than one table and
can be used to form a relationship, or link, between the
tables
• SECONDARY KEY
• A field or combination of fields that can be used to access
or retrieve records
17
Data Design Terms (Cont.)
• Referential Integrity:
• A set of rules that
avoids data
inconsistency and
quality problems. In
a relational database,
referential integrity
means that a foreign
key value cannot be
entered in one table
unless it matches an
existing primary key
in another table
FIGURE 9-13 Microsoft Access allows a user to specify that
referential integrity rules will be enforced in a relational
database design
18
Entity-Relationship Diagrams
• Drawing an ERD
• The first step is to list the entities
that you identified during the
systems analysis phase and to
consider the nature of the
relationships that link them
• Types of Relationships
• Three types of relationships can
exist between entities:
• One-to-one
• One-to-many
• Many-to-many
• A one-to-one relationship,
abbreviated 1:1, exists
when exactly one of the
second entity occurs for
each instance of the first
entity
• Figure 9-15 shows
examples of several 1:1
relationships
• A number 1 is placed
alongside each of the two
FIGURE 9-15 Examples of one-to-one (1:1) connecting lines to
relationships
indicate the 1:1
relationship
20
Entity-Relationship Diagrams
(Cont.)
• A one-to-many
relationship, abbreviated
1:M, exists when one
occurrence of the first
entity can relate to many
instances of the second
entity, but each instance of
the second entity can
associate with only one
instance of the first entity
21
Entity-Relationship Diagrams
(Cont.)
• A many-to-many
relationship,
abbreviated M:N,
exists when one
instance of the first
entity can relate to
many instances of
the second entity,
and one instance of
the second entity
can relate to many
instances of the first
entity
FIGURE 9-17 Examples of many-to-many (M:N) relationships.
Notice that the event or transaction that links the two entities is
an associative entity with its own set of attributes and
characteristics
22
Entity-Relationship Diagrams
(Cont.)
23
Entity-Relationship Diagrams
(Cont.)
• Cardinality
• Describes the numeric
relationship between
two entities and shows
how instances of one
entity relate to instances
of another entity
• A common method of
cardinality notation is
called crow’s foot
notation because of the
shapes, which include
circles, bars, and symbols,
FIGURE 9-19 Crow’s foot notation is a
that indicate various possibilities common method of indicating cardinality.
The four examples show how you can use
various symbols to describe the
relationships between entities
24
Entity-Relationship Diagrams
(Cont.)
FIGURE 9-20 In the
first example of
cardinality notation,
one and only one
CUSTOMER can place
anywhere from zero to
many of the ORDER
entity.
In the second example,
one and only one
ORDER can include
one ITEM ORDERED
or many.
In the third example,
one and only one
EMPLOYEE can have
one SPOUSE or none.
In the fourth example,
one EMPLOYEE, or
many employees, or
none, can be assigned
to one PROJECT, or
many projects, or none
25
Entity-Relationship Diagrams
(Cont.)
26
Data Normalization
• Normalization is the process of creating table
designs by assigning specific fields or attributes to
each table in the database
• Normalization involves applying a set of rules that
can help you identify and correct inherent
problems and complexities in your table designs
• The normalization process typically involves four
stages:
• Unnormalized design
• First normal form
• Second normal form
• Third normal form
27
Data Normalization (Cont.)
28
Data Normalization (Cont.)
FIGURE 9-22 In the ORDER table design, two orders have repeating groups
that contain several products. ORDER is the primary key for the ORDER table,
and PRODUCT NUMBER serves as a primary key for the repeating group.
Because it contains repeating groups, the ORDER table is unnormalized
29
Data Normalization (Cont.)
30
Data Normalization (Cont.)
32
Data Normalization (Cont.)
33
Data Normalization (Cont.)
34
Data Normalization (Cont.)
35
Two Real-World Examples
Example 1: Crossroads College
37
Two Real-World Examples (Cont.)
FIGURE 9-33 A
relational database
design for a computer
service company uses
common fields to link
the tables and form an
overall data structure.
Notice the one-to-
many notation
symbols, and the
primary keys, which
are indicated with
gold-colored key
symbols
41
Two Real-World Examples (Cont.)
42
Working with a Relational Database
Suppose you work in IT, and the sales team
needs answers to three specific questions
◦ Did any customers receive service after
12/14/2013? If so, who were they?
◦ Did technician Marie Johnson put in more than
six hours of labor on any service calls? If so,
which ones?
◦ Were any parts used on service calls in
Washington? If so, what were the part numbers,
descriptions, and quantities?
43
Working with a Relational Database
(Cont.)
47
Should You Use Codes? (Cont.)
Types of Codes
◦ Codes should be easy to learn and apply
◦ Sequence Codes
Numbers or letters assigned in a specific order
Contain no additional information other than an
indication of order of entry into the system
◦ Block sequence codes
Use blocks of numbers for different classifications
100-level courses are freshman-level
200-level courses are sophomore-level
48
Should You Use Codes? (Cont.)
◦ Alphabetic codes
Use alphabet letters to distinguish one item from
another
Category codes identify a group of related items
A department store may use a two-character category code to
identify the department
Abbreviation codes are alphabetic abbreviations
State codes include NY for New York, ME for Maine, and MN for
Minnesota
Some abbreviation codes are called mnemonic codes
because they use a specific combination of letters that are
easy to remember
49
Should You Use Codes? (Cont.)
51
Should You Use Codes? (Cont.)
FIGURE 9-40 Sample of a code that uses significant digits to pinpoint the location of an
inventory item
Designing Codes
◦ Keep codes concise
◦ Allow for expansion
◦ Keep codes stable
◦ Make codes unique
◦ Use sortable codes
◦ Use a simple structure
◦ Avoid confusion
◦ Make codes meaningful
◦ Use a code for a single purpose
◦ Keep codes consistent
53
Data Storage and Access
Tools and Techniques
◦ Companies use data warehousing and data
mining as strategic tools to help manage the
huge quantities of data they need for business
operations and decisions
◦ Data warehousing
◦ Data mining
54
Data Storage and Access (Cont.)
Data Warehousing
◦ An integrated
collection of data
that can include
seemingly unrelated
information, no
matter where it
is stored in
the
company
Data Mining
◦ Looks for
meaningful
data patterns and
relationships in
large amounts
of data
56
Data Storage and Access (Cont.)
57
Data Storage and Access (Cont.)
Data Coding
◦ EBCDIC (Extended Binary Coded Decimal
Interchange Code - pronounced EB-see-dik)
A coding method used on mainframe computers
and high-capacity servers
◦ ASCII (American Standard Code for Information
Interchange - pronounced ASK-ee)
A coding method used on most personal
computers
◦ BINARY
Represents numbers as actual binary values,
rather than as coded numeric digits
58
Data Storage and Access (Cont.)
◦ UNICODE
Supports virtually all languages and has become a
global standard
◦ STORING DATES
Y2K Issue
International
Organization for
Standardization (ISO)
requires a
format of four digits
for the year, two for
the month, and two FIGURE 9-45 Microsoft Excel uses absolute dates in
for the day calculations. In this example, September 27, 2013, is
(YYYYMMDD) displayed as 41544, and July 13, 2012, is displayed as
41103. The difference between the dates is 441 days
60
Data Control
A well-designed DBMS must provide built-
in control and security features, including
subschemas, passwords, encryption, audit
trail files, and backup and recovery
procedures to maintain data
61
Chapter Summary
A database consists of linked tables that
form an overall data structure
A database management system (DBMS) is a
62
Chapter Summary (Cont.)
63
Chapter Summary (Cont.)
64
Chapter Summary (Cont.)
65