SlideShare a Scribd company logo
1 of 55
Chapter 17 
Designing Databases 
Systems Analysis and Design 
Kendall and Kendall 
Fifth Edition
Major Topics 
 Files 
 Databases 
 Normalization 
 Key design 
 Using the database 
 Data warehouses 
 Data mining 
Kendall & 
Kendall 
Copyright © 2002 by 
Prentice Hall, Inc. 17-2
Data Storage Design 
Objectives 
 The objectives in the design of data 
storage organization are 
 The data must be available when the user 
wants to use it 
 The data must have integrity 
 It must be accurate and consistent 
 Efficient storage of data as well as efficient 
updating and retrieval 
Kendall & 
Kendall 
Copyright © 2002 by 
Prentice Hall, Inc. 17-3
Data Storage Design 
Objectives 
 Further design objectives 
 The information retrieval be purposeful 
 The information obtained from the stored 
data must be in an integrated form to be 
useful for 
 Managing 
 Planning 
 Controlling 
 Decision making 
Kendall & 
Kendall 
Copyright © 2002 by 
Prentice Hall, Inc. 17-4
Approaches to Data Storage 
 There are two approaches to the 
storage of data in a computer system 
 Store the data in individual files each 
unique to a particular application 
 Storage of data in a computer-based 
system involves building a database 
 A formally defined and centrally controlled store 
of data intended for use in many different 
applications 
Kendall & 
Kendall 
Copyright © 2002 by 
Prentice Hall, Inc. 17-5
Kendall & 
Kendall 
Copyright © 2002 by 
Prentice Hall, Inc. 17-6 
Files 
 A file can be designed and built quite 
rapidly, and the concerns for data 
availability and security are minimized 
 Analysts can choose an appropriate file 
structure according to the required 
processing speed of the particular 
application system
Objectives of Effective 
Databases 
 The effectiveness objectives of the 
database include 
 Ensuring that data can be shared among 
users for a variety of applications 
 Maintaining data that are both accurate 
and consistent 
 Ensuring all data required for current and 
future applications will be readily available 
Kendall & 
Kendall 
Copyright © 2002 by 
Prentice Hall, Inc. 17-7
Objectives of Effective 
Databases 
 Further effectiveness objectives of the 
database include 
 Allowing the database to evolve and the 
needs of the users to grow 
 Allowing users to construct their personal 
view of the data without concern for the 
way the data are physically stored 
Kendall & 
Kendall 
Copyright © 2002 by 
Prentice Hall, Inc. 17-8
Efficiency Measures of 
Database Design 
 The efficiency measures of database 
design are 
 Time and cost required for the design and 
development of the database 
 Cost for operation and maintenance 
 Cost for the hardware installation 
 Cost for user training 
Kendall & 
Kendall 
Copyright © 2002 by 
Prentice Hall, Inc. 17-9
Kendall & 
Kendall 
Copyright © 2002 by 
Prentice Hall, Inc. 17-10 
Metadata 
 Metadata is the information that 
describes data in the file or database 
 Used to help users understand the form 
and structure of the data
Entity-Relationship Concepts 
 Entities are objects or events for which 
data is collected and stored 
 An entity subtype represents data about 
an entity that may not be found on 
every record 
 Relationships are associations between 
entities 
Kendall & 
Kendall 
Copyright © 2002 by 
Prentice Hall, Inc. 17-11
Kendall & 
Kendall 
Copyright © 2002 by 
Prentice Hall, Inc. 17-12 
Entities 
 A distinct collection of data for one 
person, place, thing, or event 
 Entities become files of database 
tables 
Customer
Associative Entity 
 Associative Entity - links two entities 
 An associative entity can only exist 
between two entities 
 Associative entities become database 
tables 
Kendall & 
Kendall 
Order 
Item 
Copyright © 2002 by 
Prentice Hall, Inc. 17-13
Attributive Entity 
 Attributive Entity - describes attributes, 
especially repeating elements 
 Attributive entities tables, table files or 
database code tables 
Kendall & 
Kendall 
Book 
Subject 
Copyright © 2002 by 
Prentice Hall, Inc. 17-14
Associative Entity 
 The relationship line between a many-to- 
many relationship becomes an 
associative entity, sometimes called a 
composite entity or gerund 
Kendall & 
Kendall 
Copyright © 2002 by 
Prentice Hall, Inc. 17-15
Associative Entity Connections 
 Each entity end has a “one” connection 
 The associative entity has a “many” 
connection on each side 
Kendall & 
Kendall 
Copyright © 2002 by 
Prentice Hall, Inc. 17-16
Associative Entity Keys 
 The key fields for the associative entity 
are 
 The primary key for each “one” end is a 
foreign key on the associative entity 
 Both foreign keys concatenated together 
become the primary key 
Kendall & 
Kendall 
Copyright © 2002 by 
Prentice Hall, Inc. 17-17
Relationships 
 Relationships may be 
 One-to-one 
 One-to-many 
 Many-to-many 
 A single vertical line represents one 
 A circle represents zero or none 
 A crows foot represents many 
Kendall & 
Kendall 
Copyright © 2002 by 
Prentice Hall, Inc. 17-18
Relationships 
Kendall & 
Kendall 
Many One 
Many NoneO 
Copyright © 2002 by 
Prentice Hall, Inc. 17-19
Kendall & 
Kendall 
Copyright © 2002 by 
Prentice Hall, Inc. 17-20 
Ordinality 
 The ordinality is the minimum number 
that can occur in a relationship 
 If the ordinality is zero, it means that it is 
possible to have none of the entity 
Item O Order
Entity Subtype 
Student 
Internship 
 A special one-to-one relationship 
 It is used to represent additional 
attributes, which may not be present on 
every record of the first entity 
 This eliminates null fields on the primary 
database 
 For example, a company that has 
preferred customers, or student interns 
Kendall & 
Kendall 
Copyright © 2002 by 
Prentice Hall, Inc. 17-21
Kendall & 
Kendall 
Copyright © 2002 by 
Prentice Hall, Inc. 17-22 
Self-Join 
 A self-join is when a record has a 
relationship with another record on the 
same file
Attributes, Records, and Keys 
 Attributes are a characteristic of an 
entity, sometimes called a field 
 Records are a collection of data items 
that have something in common 
 Keys are data items in a record used to 
identify the record 
Kendall & 
Kendall 
Copyright © 2002 by 
Prentice Hall, Inc. 17-23
Key Types 
 Key types are 
 Primary key, unique for the record 
 Secondary key, a key which may not be 
unique 
 Concatenated key, a combination of two or 
more data items for the key 
 Foreign key, a data item in one record that 
is the key of another record 
Kendall & 
Kendall 
Copyright © 2002 by 
Prentice Hall, Inc. 17-24
Kendall & 
Kendall 
Copyright © 2002 by 
Prentice Hall, Inc. 17-25 
Files 
 A file contains groups of records used 
to provide information for operations, 
planning, management, and decision 
making 
 Files can be used for storing data for an 
indefinite period of time, or they can be 
used to store data temporarily for a 
specific purpose
File Types 
 Types of files available 
 Master file 
 Transaction file 
 Table file 
 Work file 
 Report file 
Kendall & 
Kendall 
Copyright © 2002 by 
Prentice Hall, Inc. 17-26
Master and Transaction Files 
 Master files 
 Have large records 
 Contain all pertinent information about an 
entity 
 Transaction records 
 Are short records 
 Contain information used to update master 
files 
Kendall & 
Kendall 
Copyright © 2002 by 
Prentice Hall, Inc. 17-27
File Organization 
 There are different organizational 
structures for file design 
 Sequential organization 
 Linked lists 
 Hashed file organization 
 Indexed organization 
 Indexed-sequential organization 
 VSAM (Virtual Storage Access Method), 
sequential and indexed-sequential files 
Kendall & 
Kendall 
Copyright © 2002 by 
Prentice Hall, Inc. 17-28
Databases 
 A database is intended to be shared by 
many users 
 There are three structures for storing 
database files: 
 Hierarchical database structures 
 Network database structures 
 Relational database structures 
Kendall & 
Kendall 
Copyright © 2002 by 
Prentice Hall, Inc. 17-29
Normalization 
 Normalization is the transformation of 
complex user views and data to a set of 
smaller, stable, and easily maintainable 
data structures 
Kendall & 
Kendall 
Copyright © 2002 by 
Prentice Hall, Inc. 17-30
Normalization 
 Normalization creates data that are 
stored only once on a file 
 The exception is key fields 
 This eliminates redundant data storage 
 It provides ideal data storage for 
database systems 
Kendall & 
Kendall 
Copyright © 2002 by 
Prentice Hall, Inc. 17-31
Three Steps of Data 
Normalization 
 The three steps of data normalization 
are 
 Remove all repeating groups and identify 
the primary key 
 Ensure that all nonkey attributes are fully 
dependent on the primary key 
 Remove any transitive dependencies, 
attributes which are dependent on other 
nonkey attributes 
Kendall & 
Kendall 
Copyright © 2002 by 
Prentice Hall, Inc. 17-32
Normalization 
Remove repeating groups 
Remove partial dependencies 
Remove transitive dependencies 
Kendall & 
Kendall 
Unnormalized 
Relationship 
Normalized 
Relations (1NF) 
Second Normal Form 
Relations (2NF) 
Third Normal Form 
Relations (1NF) 
User View 
Copyright © 2002 by 
Prentice Hall, Inc. 17-33
Data Model Diagrams 
 Data model diagrams are used to show 
relationships between attributes 
 An oval represents an attribute 
 A single arrow line represents one 
 A double arrow line represents many 
Customer 
Number 
Kendall & 
Kendall 
Salesperson 
Number 
Copyright © 2002 by 
Prentice Hall, Inc. 17-34
First Normal Form (1NF) 
 Remove any repeating groups 
 All repeating groups are moved into a 
new table 
 Foreign keys are used to link the tables 
 When a relation contains no repeating 
groups, is in the first normal form 
 Keys must be included to link the 
relations, tables 
Kendall & 
Kendall 
Copyright © 2002 by 
Prentice Hall, Inc. 17-35
Second Normal Form (2NF) 
 Remove any partial dependencies 
 A partial dependency is when the data 
are only dependent on a part of a key 
field 
 A relation is created for the data that 
are only dependent on part of the key 
and another for data that are dependent 
on both parts 
Kendall & 
Kendall 
Copyright © 2002 by 
Prentice Hall, Inc. 17-36
Third Normal Form (3NF) 
 Remove any transitive dependencies 
 A transitive dependency is when a 
relation contains data that are not part 
of the entity 
 The problem with transitive 
dependencies is updating the data 
 A single data item may be present on 
many records 
Kendall & 
Kendall 
Copyright © 2002 by 
Prentice Hall, Inc. 17-37
Entity-Relationship Diagram 
and Record Keys 
 The entity-relationship diagram may be 
used to determine record keys 
 When the relationship is one-to-many, the 
primary key of the file at the one end of the 
relationship should be contained as a 
foreign key on the file at the many end of 
the relationship 
 A many-to-many relationship should be 
divided into two one-to-many relationships 
with an associative entity in the middle 
Kendall & 
Kendall 
Copyright © 2002 by 
Prentice Hall, Inc. 17-38
Guidelines for Creating Master 
Files or Database Relations 
 Guidelines for creating master files or 
database relations are 
 Each separate entity should have it's own 
master file or database relation 
 A specific, nonkey data field should exist 
on only one master file or relation 
 Each master file or relation should have 
programs to create, read, update, and 
delete records 
Kendall & 
Kendall 
Copyright © 2002 by 
Prentice Hall, Inc. 17-39
Integrity Constraints 
 There are three integrity constraints that 
help to ensure that the database 
contains accurate data: 
 Entity integrity constraints, which govern 
the composition of primary keys 
 Referential integrity, which governs the 
denature of records in a one-to-many 
relationship 
 Domain integrity 
Kendall & 
Kendall 
Copyright © 2002 by 
Prentice Hall, Inc. 17-40
Entity Integrity 
 Entity integrity constraints are rules for 
primary keys: 
 The primary key cannot have a null value 
 If the primary key is a composite key, none 
of the fields in the key can contain a null 
value 
Kendall & 
Kendall 
Copyright © 2002 by 
Prentice Hall, Inc. 17-41
Referential Integrity 
 Referential integrity governs the 
denature of records in a one-to-many 
relationship 
 Referential integrity means that all 
foreign keys in one table (the child 
table) must have a matching record in 
the parent table 
Kendall & 
Kendall 
Copyright © 2002 by 
Prentice Hall, Inc. 17-42
Referential Integrity 
 Referential integrity includes 
 You cannot add a record without a 
matching foreign key record 
 You cannot change a primary key that has 
matching child table records 
 A child table that has a foreign key for a 
different record 
 You cannot delete a record that has child 
records 
Kendall & 
Kendall 
Copyright © 2002 by 
Prentice Hall, Inc. 17-43
Referential Integrity 
 A restricted database updates or 
deletes a key only if there are no 
matching child records 
 A cascaded database will delete or 
update all child records when a parent 
record is deleted or changed 
 The parent triggers the changes 
Kendall & 
Kendall 
Copyright © 2002 by 
Prentice Hall, Inc. 17-44
Domain Integrity 
 Domain integrity defines rules that 
ensure that only valid data are stored 
on database records 
 Domain integrity has two forms: 
 Check constraints, which are defined at the 
table level 
 Rules, which are defined as separate objects 
and may be used within a number of fields 
Kendall & 
Kendall 
Copyright © 2002 by 
Prentice Hall, Inc. 17-45
Retrieving and Presenting 
Database Data 
 Guidelines to retrieve and present data 
 Choose a relation from the database 
 Join two relations together 
 Project columns from the relation 
 Select rows from the relation 
 Derive new attributes 
 Index or sort rows 
 Calculate totals and performance 
measures 
 Present data 
Kendall & 
Kendall 
Copyright © 2002 by 
Prentice Hall, Inc. 17-46
Denormalization 
 Denormalization is the process of taking 
the logical data model and transforming 
it into an efficient physical model 
Kendall & 
Kendall 
Copyright © 2002 by 
Prentice Hall, Inc. 17-47
Data Warehouses 
 Data warehouses are used to organize 
information for quick and effective 
queries 
Kendall & 
Kendall 
Copyright © 2002 by 
Prentice Hall, Inc. 17-48
Data Warehouses and 
Database Differences 
 In the data warehouse, data are 
organized around major subjects 
 Data in the warehouse are stored as 
summarized rather than detailed raw 
data 
 Data in the data warehouse cover a 
much longer time frame than in a 
traditional transaction-oriented 
database 
Kendall & 
Kendall 
Copyright © 2002 by 
Prentice Hall, Inc. 17-49
Data Warehouses and 
Database Differences 
 Data warehouses are organized for fast 
queries 
 Data warehouses are usually optimized 
for answering complex queries, known 
as OLAP 
 Data warehouses allow for easy access 
via data-mining software called siftware 
Kendall & 
Kendall 
Copyright © 2002 by 
Prentice Hall, Inc. 17-50
Data Warehouses and 
Database Differences 
 Data warehouses include multiple 
databases that have been processed so 
that data are uniformly defined, 
containing what is referred to as “clean” 
data 
 Data warehouses usually contain data 
from outside sources 
Kendall & 
Kendall 
Copyright © 2002 by 
Prentice Hall, Inc. 17-51
Online Analytic Processing 
(OLAP) 
 Online analytic processing (OLAP) is 
meant to answer decision makers’ complex 
questions by defining a multidimensional 
database 
 Data mining, or knowledge data discovery 
(KDD), is the process of identifying 
patterns that a human is incapable of 
detecting 
Kendall & 
Kendall 
Copyright © 2002 by 
Prentice Hall, Inc. 17-52
Data Mining Decision Aids 
 Data mining has a number of decision 
aids available, including 
 Statistical analysis 
 Decision trees 
 Neural networks 
 Fuzzy logic 
 Data visualization 
Kendall & 
Kendall 
Copyright © 2002 by 
Prentice Hall, Inc. 17-53
Data Mining Patterns 
 Data mining patterns that decision 
makers try to identify include 
 Associations, patterns that occur together 
 Sequences, patterns of actions that take 
place over a period of time 
 Clustering, patterns that develop among 
groups of people 
 Trends, the patterns that are noticed over a 
period of time 
Kendall & 
Kendall 
Copyright © 2002 by 
Prentice Hall, Inc. 17-54
Web Based Databases and 
XML 
 Web-based databases are used for 
sharing data 
 Extensible markup language (XML) is 
used to define data used primarily for 
business data exchange over the Web 
 An XML document contains only data and 
the nature of the data 
Kendall & 
Kendall 
Copyright © 2002 by 
Prentice Hall, Inc. 17-55

More Related Content

What's hot

What's hot (20)

Chap22
Chap22Chap22
Chap22
 
Chap20
Chap20Chap20
Chap20
 
Chap06
Chap06Chap06
Chap06
 
Chap01
Chap01Chap01
Chap01
 
Chap12
Chap12Chap12
Chap12
 
Chap07
Chap07Chap07
Chap07
 
Chap09
Chap09Chap09
Chap09
 
Chap04
Chap04Chap04
Chap04
 
Ch10-Program Design
Ch10-Program DesignCh10-Program Design
Ch10-Program Design
 
Kendall sad8e ch03
Kendall sad8e ch03Kendall sad8e ch03
Kendall sad8e ch03
 
Datamodelling
DatamodellingDatamodelling
Datamodelling
 
Eform & Workflow Software
Eform & Workflow SoftwareEform & Workflow Software
Eform & Workflow Software
 
A Quick Introduction to E-Forms
A Quick Introduction to E-FormsA Quick Introduction to E-Forms
A Quick Introduction to E-Forms
 
Chapter16 designing distributed and internet systems
Chapter16 designing distributed and internet systemsChapter16 designing distributed and internet systems
Chapter16 designing distributed and internet systems
 
Projman
ProjmanProjman
Projman
 
MDMF DPGI Presentation
MDMF DPGI PresentationMDMF DPGI Presentation
MDMF DPGI Presentation
 
Select an e forms vendor
Select an e forms vendorSelect an e forms vendor
Select an e forms vendor
 
Chapter 1
Chapter 1Chapter 1
Chapter 1
 
Edi,idoc,ale
Edi,idoc,aleEdi,idoc,ale
Edi,idoc,ale
 
MDMF DPGI Presentation
MDMF DPGI PresentationMDMF DPGI Presentation
MDMF DPGI Presentation
 

Similar to Chap17

Designing database week ix part 1
Designing database week ix part 1Designing database week ix part 1
Designing database week ix part 1Johnecis Madrid
 
Ch11-Data Storage Design
Ch11-Data Storage DesignCh11-Data Storage Design
Ch11-Data Storage DesignFajar Baskoro
 
The Database Environment Chapter 1
The Database Environment Chapter 1The Database Environment Chapter 1
The Database Environment Chapter 1Jeanie Arnoco
 
TID Chapter 10 Introduction To Database
TID Chapter 10 Introduction To DatabaseTID Chapter 10 Introduction To Database
TID Chapter 10 Introduction To DatabaseWanBK Leo
 
Database Systems-Lec 1.ppt
Database Systems-Lec 1.pptDatabase Systems-Lec 1.ppt
Database Systems-Lec 1.pptsara591850
 
Behind The Scenes Databases And Information Systems 6
Behind The Scenes  Databases And Information Systems 6Behind The Scenes  Databases And Information Systems 6
Behind The Scenes Databases And Information Systems 6guest4a9cdb
 
The Database Environment Chapter 11
The Database Environment Chapter 11The Database Environment Chapter 11
The Database Environment Chapter 11Jeanie Arnoco
 
Database Management System Introduction
Database Management System IntroductionDatabase Management System Introduction
Database Management System IntroductionSmriti Jain
 
II-SDV 2012 Merging Information from Structured and Unstructured Information ...
II-SDV 2012 Merging Information from Structured and Unstructured Information ...II-SDV 2012 Merging Information from Structured and Unstructured Information ...
II-SDV 2012 Merging Information from Structured and Unstructured Information ...Dr. Haxel Consult
 

Similar to Chap17 (20)

Designing database week ix part 1
Designing database week ix part 1Designing database week ix part 1
Designing database week ix part 1
 
Chap02
Chap02Chap02
Chap02
 
D.dsgn + dbms
D.dsgn + dbmsD.dsgn + dbms
D.dsgn + dbms
 
Chap01
Chap01Chap01
Chap01
 
Ch11-Data Storage Design
Ch11-Data Storage DesignCh11-Data Storage Design
Ch11-Data Storage Design
 
The Database Environment Chapter 1
The Database Environment Chapter 1The Database Environment Chapter 1
The Database Environment Chapter 1
 
TID Chapter 10 Introduction To Database
TID Chapter 10 Introduction To DatabaseTID Chapter 10 Introduction To Database
TID Chapter 10 Introduction To Database
 
Database Systems-Lec 1.ppt
Database Systems-Lec 1.pptDatabase Systems-Lec 1.ppt
Database Systems-Lec 1.ppt
 
Data dictionary
Data dictionaryData dictionary
Data dictionary
 
Database Systems Concepts, 5th Ed
Database Systems Concepts, 5th EdDatabase Systems Concepts, 5th Ed
Database Systems Concepts, 5th Ed
 
5279413.ppt
5279413.ppt5279413.ppt
5279413.ppt
 
Intro_toDB.ppt
Intro_toDB.pptIntro_toDB.ppt
Intro_toDB.ppt
 
Behind The Scenes Databases And Information Systems 6
Behind The Scenes  Databases And Information Systems 6Behind The Scenes  Databases And Information Systems 6
Behind The Scenes Databases And Information Systems 6
 
The Database Environment Chapter 11
The Database Environment Chapter 11The Database Environment Chapter 11
The Database Environment Chapter 11
 
Chapter 12
Chapter 12Chapter 12
Chapter 12
 
Final
FinalFinal
Final
 
Database Management System Introduction
Database Management System IntroductionDatabase Management System Introduction
Database Management System Introduction
 
II-SDV 2012 Merging Information from Structured and Unstructured Information ...
II-SDV 2012 Merging Information from Structured and Unstructured Information ...II-SDV 2012 Merging Information from Structured and Unstructured Information ...
II-SDV 2012 Merging Information from Structured and Unstructured Information ...
 
Tg03
Tg03Tg03
Tg03
 
Tg03
Tg03Tg03
Tg03
 

Chap17

  • 1. Chapter 17 Designing Databases Systems Analysis and Design Kendall and Kendall Fifth Edition
  • 2. Major Topics  Files  Databases  Normalization  Key design  Using the database  Data warehouses  Data mining Kendall & Kendall Copyright © 2002 by Prentice Hall, Inc. 17-2
  • 3. Data Storage Design Objectives  The objectives in the design of data storage organization are  The data must be available when the user wants to use it  The data must have integrity  It must be accurate and consistent  Efficient storage of data as well as efficient updating and retrieval Kendall & Kendall Copyright © 2002 by Prentice Hall, Inc. 17-3
  • 4. Data Storage Design Objectives  Further design objectives  The information retrieval be purposeful  The information obtained from the stored data must be in an integrated form to be useful for  Managing  Planning  Controlling  Decision making Kendall & Kendall Copyright © 2002 by Prentice Hall, Inc. 17-4
  • 5. Approaches to Data Storage  There are two approaches to the storage of data in a computer system  Store the data in individual files each unique to a particular application  Storage of data in a computer-based system involves building a database  A formally defined and centrally controlled store of data intended for use in many different applications Kendall & Kendall Copyright © 2002 by Prentice Hall, Inc. 17-5
  • 6. Kendall & Kendall Copyright © 2002 by Prentice Hall, Inc. 17-6 Files  A file can be designed and built quite rapidly, and the concerns for data availability and security are minimized  Analysts can choose an appropriate file structure according to the required processing speed of the particular application system
  • 7. Objectives of Effective Databases  The effectiveness objectives of the database include  Ensuring that data can be shared among users for a variety of applications  Maintaining data that are both accurate and consistent  Ensuring all data required for current and future applications will be readily available Kendall & Kendall Copyright © 2002 by Prentice Hall, Inc. 17-7
  • 8. Objectives of Effective Databases  Further effectiveness objectives of the database include  Allowing the database to evolve and the needs of the users to grow  Allowing users to construct their personal view of the data without concern for the way the data are physically stored Kendall & Kendall Copyright © 2002 by Prentice Hall, Inc. 17-8
  • 9. Efficiency Measures of Database Design  The efficiency measures of database design are  Time and cost required for the design and development of the database  Cost for operation and maintenance  Cost for the hardware installation  Cost for user training Kendall & Kendall Copyright © 2002 by Prentice Hall, Inc. 17-9
  • 10. Kendall & Kendall Copyright © 2002 by Prentice Hall, Inc. 17-10 Metadata  Metadata is the information that describes data in the file or database  Used to help users understand the form and structure of the data
  • 11. Entity-Relationship Concepts  Entities are objects or events for which data is collected and stored  An entity subtype represents data about an entity that may not be found on every record  Relationships are associations between entities Kendall & Kendall Copyright © 2002 by Prentice Hall, Inc. 17-11
  • 12. Kendall & Kendall Copyright © 2002 by Prentice Hall, Inc. 17-12 Entities  A distinct collection of data for one person, place, thing, or event  Entities become files of database tables Customer
  • 13. Associative Entity  Associative Entity - links two entities  An associative entity can only exist between two entities  Associative entities become database tables Kendall & Kendall Order Item Copyright © 2002 by Prentice Hall, Inc. 17-13
  • 14. Attributive Entity  Attributive Entity - describes attributes, especially repeating elements  Attributive entities tables, table files or database code tables Kendall & Kendall Book Subject Copyright © 2002 by Prentice Hall, Inc. 17-14
  • 15. Associative Entity  The relationship line between a many-to- many relationship becomes an associative entity, sometimes called a composite entity or gerund Kendall & Kendall Copyright © 2002 by Prentice Hall, Inc. 17-15
  • 16. Associative Entity Connections  Each entity end has a “one” connection  The associative entity has a “many” connection on each side Kendall & Kendall Copyright © 2002 by Prentice Hall, Inc. 17-16
  • 17. Associative Entity Keys  The key fields for the associative entity are  The primary key for each “one” end is a foreign key on the associative entity  Both foreign keys concatenated together become the primary key Kendall & Kendall Copyright © 2002 by Prentice Hall, Inc. 17-17
  • 18. Relationships  Relationships may be  One-to-one  One-to-many  Many-to-many  A single vertical line represents one  A circle represents zero or none  A crows foot represents many Kendall & Kendall Copyright © 2002 by Prentice Hall, Inc. 17-18
  • 19. Relationships Kendall & Kendall Many One Many NoneO Copyright © 2002 by Prentice Hall, Inc. 17-19
  • 20. Kendall & Kendall Copyright © 2002 by Prentice Hall, Inc. 17-20 Ordinality  The ordinality is the minimum number that can occur in a relationship  If the ordinality is zero, it means that it is possible to have none of the entity Item O Order
  • 21. Entity Subtype Student Internship  A special one-to-one relationship  It is used to represent additional attributes, which may not be present on every record of the first entity  This eliminates null fields on the primary database  For example, a company that has preferred customers, or student interns Kendall & Kendall Copyright © 2002 by Prentice Hall, Inc. 17-21
  • 22. Kendall & Kendall Copyright © 2002 by Prentice Hall, Inc. 17-22 Self-Join  A self-join is when a record has a relationship with another record on the same file
  • 23. Attributes, Records, and Keys  Attributes are a characteristic of an entity, sometimes called a field  Records are a collection of data items that have something in common  Keys are data items in a record used to identify the record Kendall & Kendall Copyright © 2002 by Prentice Hall, Inc. 17-23
  • 24. Key Types  Key types are  Primary key, unique for the record  Secondary key, a key which may not be unique  Concatenated key, a combination of two or more data items for the key  Foreign key, a data item in one record that is the key of another record Kendall & Kendall Copyright © 2002 by Prentice Hall, Inc. 17-24
  • 25. Kendall & Kendall Copyright © 2002 by Prentice Hall, Inc. 17-25 Files  A file contains groups of records used to provide information for operations, planning, management, and decision making  Files can be used for storing data for an indefinite period of time, or they can be used to store data temporarily for a specific purpose
  • 26. File Types  Types of files available  Master file  Transaction file  Table file  Work file  Report file Kendall & Kendall Copyright © 2002 by Prentice Hall, Inc. 17-26
  • 27. Master and Transaction Files  Master files  Have large records  Contain all pertinent information about an entity  Transaction records  Are short records  Contain information used to update master files Kendall & Kendall Copyright © 2002 by Prentice Hall, Inc. 17-27
  • 28. File Organization  There are different organizational structures for file design  Sequential organization  Linked lists  Hashed file organization  Indexed organization  Indexed-sequential organization  VSAM (Virtual Storage Access Method), sequential and indexed-sequential files Kendall & Kendall Copyright © 2002 by Prentice Hall, Inc. 17-28
  • 29. Databases  A database is intended to be shared by many users  There are three structures for storing database files:  Hierarchical database structures  Network database structures  Relational database structures Kendall & Kendall Copyright © 2002 by Prentice Hall, Inc. 17-29
  • 30. Normalization  Normalization is the transformation of complex user views and data to a set of smaller, stable, and easily maintainable data structures Kendall & Kendall Copyright © 2002 by Prentice Hall, Inc. 17-30
  • 31. Normalization  Normalization creates data that are stored only once on a file  The exception is key fields  This eliminates redundant data storage  It provides ideal data storage for database systems Kendall & Kendall Copyright © 2002 by Prentice Hall, Inc. 17-31
  • 32. Three Steps of Data Normalization  The three steps of data normalization are  Remove all repeating groups and identify the primary key  Ensure that all nonkey attributes are fully dependent on the primary key  Remove any transitive dependencies, attributes which are dependent on other nonkey attributes Kendall & Kendall Copyright © 2002 by Prentice Hall, Inc. 17-32
  • 33. Normalization Remove repeating groups Remove partial dependencies Remove transitive dependencies Kendall & Kendall Unnormalized Relationship Normalized Relations (1NF) Second Normal Form Relations (2NF) Third Normal Form Relations (1NF) User View Copyright © 2002 by Prentice Hall, Inc. 17-33
  • 34. Data Model Diagrams  Data model diagrams are used to show relationships between attributes  An oval represents an attribute  A single arrow line represents one  A double arrow line represents many Customer Number Kendall & Kendall Salesperson Number Copyright © 2002 by Prentice Hall, Inc. 17-34
  • 35. First Normal Form (1NF)  Remove any repeating groups  All repeating groups are moved into a new table  Foreign keys are used to link the tables  When a relation contains no repeating groups, is in the first normal form  Keys must be included to link the relations, tables Kendall & Kendall Copyright © 2002 by Prentice Hall, Inc. 17-35
  • 36. Second Normal Form (2NF)  Remove any partial dependencies  A partial dependency is when the data are only dependent on a part of a key field  A relation is created for the data that are only dependent on part of the key and another for data that are dependent on both parts Kendall & Kendall Copyright © 2002 by Prentice Hall, Inc. 17-36
  • 37. Third Normal Form (3NF)  Remove any transitive dependencies  A transitive dependency is when a relation contains data that are not part of the entity  The problem with transitive dependencies is updating the data  A single data item may be present on many records Kendall & Kendall Copyright © 2002 by Prentice Hall, Inc. 17-37
  • 38. Entity-Relationship Diagram and Record Keys  The entity-relationship diagram may be used to determine record keys  When the relationship is one-to-many, the primary key of the file at the one end of the relationship should be contained as a foreign key on the file at the many end of the relationship  A many-to-many relationship should be divided into two one-to-many relationships with an associative entity in the middle Kendall & Kendall Copyright © 2002 by Prentice Hall, Inc. 17-38
  • 39. Guidelines for Creating Master Files or Database Relations  Guidelines for creating master files or database relations are  Each separate entity should have it's own master file or database relation  A specific, nonkey data field should exist on only one master file or relation  Each master file or relation should have programs to create, read, update, and delete records Kendall & Kendall Copyright © 2002 by Prentice Hall, Inc. 17-39
  • 40. Integrity Constraints  There are three integrity constraints that help to ensure that the database contains accurate data:  Entity integrity constraints, which govern the composition of primary keys  Referential integrity, which governs the denature of records in a one-to-many relationship  Domain integrity Kendall & Kendall Copyright © 2002 by Prentice Hall, Inc. 17-40
  • 41. Entity Integrity  Entity integrity constraints are rules for primary keys:  The primary key cannot have a null value  If the primary key is a composite key, none of the fields in the key can contain a null value Kendall & Kendall Copyright © 2002 by Prentice Hall, Inc. 17-41
  • 42. Referential Integrity  Referential integrity governs the denature of records in a one-to-many relationship  Referential integrity means that all foreign keys in one table (the child table) must have a matching record in the parent table Kendall & Kendall Copyright © 2002 by Prentice Hall, Inc. 17-42
  • 43. Referential Integrity  Referential integrity includes  You cannot add a record without a matching foreign key record  You cannot change a primary key that has matching child table records  A child table that has a foreign key for a different record  You cannot delete a record that has child records Kendall & Kendall Copyright © 2002 by Prentice Hall, Inc. 17-43
  • 44. Referential Integrity  A restricted database updates or deletes a key only if there are no matching child records  A cascaded database will delete or update all child records when a parent record is deleted or changed  The parent triggers the changes Kendall & Kendall Copyright © 2002 by Prentice Hall, Inc. 17-44
  • 45. Domain Integrity  Domain integrity defines rules that ensure that only valid data are stored on database records  Domain integrity has two forms:  Check constraints, which are defined at the table level  Rules, which are defined as separate objects and may be used within a number of fields Kendall & Kendall Copyright © 2002 by Prentice Hall, Inc. 17-45
  • 46. Retrieving and Presenting Database Data  Guidelines to retrieve and present data  Choose a relation from the database  Join two relations together  Project columns from the relation  Select rows from the relation  Derive new attributes  Index or sort rows  Calculate totals and performance measures  Present data Kendall & Kendall Copyright © 2002 by Prentice Hall, Inc. 17-46
  • 47. Denormalization  Denormalization is the process of taking the logical data model and transforming it into an efficient physical model Kendall & Kendall Copyright © 2002 by Prentice Hall, Inc. 17-47
  • 48. Data Warehouses  Data warehouses are used to organize information for quick and effective queries Kendall & Kendall Copyright © 2002 by Prentice Hall, Inc. 17-48
  • 49. Data Warehouses and Database Differences  In the data warehouse, data are organized around major subjects  Data in the warehouse are stored as summarized rather than detailed raw data  Data in the data warehouse cover a much longer time frame than in a traditional transaction-oriented database Kendall & Kendall Copyright © 2002 by Prentice Hall, Inc. 17-49
  • 50. Data Warehouses and Database Differences  Data warehouses are organized for fast queries  Data warehouses are usually optimized for answering complex queries, known as OLAP  Data warehouses allow for easy access via data-mining software called siftware Kendall & Kendall Copyright © 2002 by Prentice Hall, Inc. 17-50
  • 51. Data Warehouses and Database Differences  Data warehouses include multiple databases that have been processed so that data are uniformly defined, containing what is referred to as “clean” data  Data warehouses usually contain data from outside sources Kendall & Kendall Copyright © 2002 by Prentice Hall, Inc. 17-51
  • 52. Online Analytic Processing (OLAP)  Online analytic processing (OLAP) is meant to answer decision makers’ complex questions by defining a multidimensional database  Data mining, or knowledge data discovery (KDD), is the process of identifying patterns that a human is incapable of detecting Kendall & Kendall Copyright © 2002 by Prentice Hall, Inc. 17-52
  • 53. Data Mining Decision Aids  Data mining has a number of decision aids available, including  Statistical analysis  Decision trees  Neural networks  Fuzzy logic  Data visualization Kendall & Kendall Copyright © 2002 by Prentice Hall, Inc. 17-53
  • 54. Data Mining Patterns  Data mining patterns that decision makers try to identify include  Associations, patterns that occur together  Sequences, patterns of actions that take place over a period of time  Clustering, patterns that develop among groups of people  Trends, the patterns that are noticed over a period of time Kendall & Kendall Copyright © 2002 by Prentice Hall, Inc. 17-54
  • 55. Web Based Databases and XML  Web-based databases are used for sharing data  Extensible markup language (XML) is used to define data used primarily for business data exchange over the Web  An XML document contains only data and the nature of the data Kendall & Kendall Copyright © 2002 by Prentice Hall, Inc. 17-55