Upload
colleen-oconnor
View
213
Download
0
Tags:
Embed Size (px)
Citation preview
Appendix A/1 Copyright © 2004
Database Processing: Fundamentals, Design, and Implementation, 9/e by David M. Kroenke
Please…….No Food Or Drink in the class room
Cell phones off
Pagers on vibrate
Phasers on stun
Appendix A/3 Copyright © 2004
Database Processing: Fundamentals, Design, and Implementation, 9/e by David M. Kroenke
Objectives
Define the term data structures Define and illustrate the terms flat file,
sequential list, linked list ,and index Define and illustrate the B-Tree multilevel
indexes Demonstrate how binary relationships are
represented using trees, simple networks, and complex networks
Define and illustrate primary and secondary keys
Define and illustrate unique and non-unique secondary keys
Appendix A/4 Copyright © 2004
Database Processing: Fundamentals, Design, and Implementation, 9/e by David M. Kroenke
Flat Files
A flat file is a file that has no repeating groups They are usually processed in some
predetermined order
Appendix A/5 Copyright © 2004
Database Processing: Fundamentals, Design, and Implementation, 9/e by David M. Kroenke
Processing Flat Files
Flat files can be ordered using the following data structures– Sequential lists: physically placing the records in the
sequence in which they will be processed– Linked lists: attaching to each data record a pointer to
another logically related record– Indexes or inverted list: building a table, separate from
the data records that contains pointers to related records• B-trees are special applications of indexes
Data structures can be used to represent record relationships as well as secondary keys
Appendix A/6 Copyright © 2004
Database Processing: Fundamentals, Design, and Implementation, 9/e by David M. Kroenke
Example: Sequential Lists
Appendix A/7 Copyright © 2004
Database Processing: Fundamentals, Design, and Implementation, 9/e by David M. Kroenke
Example: Linked Lists
Appendix A/8 Copyright © 2004
Database Processing: Fundamentals, Design, and Implementation, 9/e by David M. Kroenke
Example: Circular Linked Lists
Appendix A/9 Copyright © 2004
Database Processing: Fundamentals, Design, and Implementation, 9/e by David M. Kroenke
Example: Two-Way Linked Lists
Appendix A/10 Copyright © 2004
Database Processing: Fundamentals, Design, and Implementation, 9/e by David M. Kroenke
Example: Indexes
Appendix A/11 Copyright © 2004
Database Processing: Fundamentals, Design, and Implementation, 9/e by David M. Kroenke
Example: B-Trees
Appendix A/12 Copyright © 2004
Database Processing: Fundamentals, Design, and Implementation, 9/e by David M. Kroenke
Example: B-Trees
Appendix A/13 Copyright © 2004
Database Processing: Fundamentals, Design, and Implementation, 9/e by David M. Kroenke
Summary of Data Structures
Appendix A/14 Copyright © 2004
Database Processing: Fundamentals, Design, and Implementation, 9/e by David M. Kroenke
Record Relationships
Records can be related in three ways– A tree relationship has 1:N relationships with
each child record has only one parent– A simple network is a collection of records and
the 1:N relationships among them– A complex network is a collection of records
and N:M relationships
Appendix A/15 Copyright © 2004
Database Processing: Fundamentals, Design, and Implementation, 9/e by David M. Kroenke
Example: Tree Structure
Appendix A/16 Copyright © 2004
Database Processing: Fundamentals, Design, and Implementation, 9/e by David M. Kroenke
Example: Simple Network
Appendix A/17 Copyright © 2004
Database Processing: Fundamentals, Design, and Implementation, 9/e by David M. Kroenke
Example: Complex Network
Appendix A/18 Copyright © 2004
Database Processing: Fundamentals, Design, and Implementation, 9/e by David M. Kroenke
Representing Trees
Sequential lists, linked lists, and indexes can be used to represent trees
Appendix A/19 Copyright © 2004
Database Processing: Fundamentals, Design, and Implementation, 9/e by David M. Kroenke
Representing Trees with Sequential List
Appendix A/20 Copyright © 2004
Database Processing: Fundamentals, Design, and Implementation, 9/e by David M. Kroenke
Representing Trees with Linked List
Appendix A/21 Copyright © 2004
Database Processing: Fundamentals, Design, and Implementation, 9/e by David M. Kroenke
Representing Trees with Indexes
Appendix A/22 Copyright © 2004
Database Processing: Fundamentals, Design, and Implementation, 9/e by David M. Kroenke
Representing Simple Networks
Simple networks can be decomposed into trees and then represented
Appendix A/23 Copyright © 2004
Database Processing: Fundamentals, Design, and Implementation, 9/e by David M. Kroenke
Representing Simple Networks with Linked List
Appendix A/24 Copyright © 2004
Database Processing: Fundamentals, Design, and Implementation, 9/e by David M. Kroenke
Representing Simple Networks with Indexes
Appendix A/25 Copyright © 2004
Database Processing: Fundamentals, Design, and Implementation, 9/e by David M. Kroenke
Representing Complex Networks Complex networks
can be decomposed into simple networks containing an intersection record and then represented
Appendix A/26 Copyright © 2004
Database Processing: Fundamentals, Design, and Implementation, 9/e by David M. Kroenke
Representing Complex Networks with Linked List
Appendix A/27 Copyright © 2004
Database Processing: Fundamentals, Design, and Implementation, 9/e by David M. Kroenke
Relationship Representations Summary
Appendix A/28 Copyright © 2004
Database Processing: Fundamentals, Design, and Implementation, 9/e by David M. Kroenke
Secondary Key Representations
Secondary keys are used to access the data on some field besides the primary key
Secondary keys can be unique or non-unique– Non-unique secondary keys can be represented with
both linked lists and indexes– Unique secondary keys can be represented only with
indexes
Appendix A/29 Copyright © 2004
Database Processing: Fundamentals, Design, and Implementation, 9/e by David M. Kroenke
Representing Secondary Keys With Linked List
Appendix A/30 Copyright © 2004
Database Processing: Fundamentals, Design, and Implementation, 9/e by David M. Kroenke
Representing Unique Secondary Keys with Indexes
Appendix A/31 Copyright © 2004
Database Processing: Fundamentals, Design, and Implementation, 9/e by David M. Kroenke
Representing Non-Unique Secondary Keys with Indexes
Appendix A/32 Copyright © 2004
Database Processing: Fundamentals, Design, and Implementation, 9/e by David M. Kroenke
Summary
A flat file is a file that contains no repeating groups
Flat files can be ordered both physically and logically
B-trees are special applications of indexes There are three basic record structures
– Trees– Simple Networks, and– Complex Networks
Appendix A/33 Copyright © 2004
Database Processing: Fundamentals, Design, and Implementation, 9/e by David M. Kroenke
ReminderDO NOT FORGET TO
SIGN THE ATTENDANCE SHEET BEFORE YOU LEAVE
TONIGHT