Presentation on theme: "File Processing and Data"— Presentation transcript:
1 File Processing and Data Management ConceptsChapter 12
2 Define the basic terms used in database technology. Learning Objective 1Define the basic terms usedin database technology.
3 Introductory Terminology FieldThese are usedinterchangeablyto denote thesmallest blockof data that willbe stored andretrieved.Data itemsAttributeElements
4 Introductory Terminology A field may be a single character or number, or itmay be composed of many characters or numbers.Customer nameEmployee social security numberPurchase order numberCustomer account number
5 Introductory Terminology Logical grouping of fields are called records.An employeeA customerA vendorAn invoice
6 Data Occurrences Ocurrences = Instances A record occurrence is a specificset of data values for the record.
7 Data Occurrences For the record EMPLOYEE (NAME, NUMBER, AGE) we might have the occurrenceEMPLOYEE (Brown, , 33)
8 Fixed- and Variable-Length Records In a fixed-length record, both the numberof fields and the length (charactersize) of each field are fixed.In variable-length records, the width of thefield can be adjusted to each data occurrence.A trailer record is an extension of a master record.
9 Several Suppliers and Warehouses Example PART_NOPNAMETYPECOSTPVEND – the name of the vendor or supplierWARHSE – where the part is storedLOC – the last two digits of the zip code
10 One Storage Location Example PART (PART_NO, PNAME, TYPE, COST,PVEND #1, WARHSE #1, LOC#1,PVEND #2, WARHSE #2, LOC#2)
11 Repeated Groups Repeated groups are related groups of fields that repeat themselves in variable-length records.SegmentsGroupsNodesPART, SUPPLIER, and LOCATIONcan be written as follows:PART (PART_NO, PNAME, TYPE, COST)
13 Record Key and File Sequence A key or record key is a data item orcombination of data items that uniquelyidentifies a particular record in a file.Primary sort keySecondary sort keyTertiary sort keysRelative random order
14 Identify the three levels of database architecture. Learning Objective 2Identify the three levels ofdatabase architecture.
15 Database Management Systems and Their Architecture Database contentsUses of databaseDesired reportsInformation to be reviewedConceptuallevel
16 Database Management Systems and Their Architecture Logical data structures:Tree (hierarchical)NetworkRelationalLogicallevel
17 Database Management Systems and Their Architecture Access methods:SequentialIndexed-sequentialDirectPhysicallevel
18 Conceptual Architecture The Entity-Relationship (E-R) data modelis a conceptual model for depicting therelationships between segments in a database."Entity" instead of segmentAttribute refers to individual fields or data items.
19 Conceptual Architecture The object-oriented modeling technique(OMT) views the components of thesystem being modeled as object classes.Object class corresponds to a segment.Object corresponds to a particular instance.Inheritance
20 Example of Object-Oriented Data Modeling Technique PLANT_EQUIPMENTACCOUNT_NOCOSTDEPRECIATIONHEAVY_EQUIPMENTMAINTENANCE_FREQDATE_PURCHASEDHAND_TOOLSUSAGE
21 Compare and contrast the different logical models of databases. Learning Objective 3Compare and contrastthe different logicalmodels of databases.
22 Logical Data Structures The relationships that exist betweenthe segments in the database aredetermined by the logical data structure,also called the schema or database model.
23 Logical Data Structures What are the three major modelsof logical data structure?1. Tree or hierarchical structures2. Network structures3. Relational models
24 Logical Data Structures Tree (hierarchical) model(4 levels and 13 nodes)ABCDEFGHIJKLM
25 Logical Data Structures Network model(3 levels and 11 nodes)ABCDEFGHIJK
26 Logical Data Structures Both trees and networks are implementedwith imbedded pointer fields.
27 Implementing Tree and Network Structures In a list organization, each recordcontains one or more pointers(fields) indicating the addressof the next logical recordwith the same attribute(s).A ring structure differs from a listin that the last record in the ringlist points back to the first record.
28 Implementing Tree and Network Structures What is a multiple ring structure?In this type of structure several ringspass through individual records.
29 List Structure Location of first record Attribute Records Index 12345RedBlueIndexPointer fieldto next recordEnd of listindicator
30 Ring Structure Location of first record Attribute Index Pointer field 2Va3KyPointer fieldto next recordPointer fieldto first recordRecords12434552
31 Relational Data Structures What is the relational model?It is a logical data structure thatviews the database as a collectionof two-dimensional tables.There are no complicated pointers or lists.
32 Relational Data Structures Relational algebraNormal formsNormalization
33 Relational Data Structures What are the three normal forms?First normal formSecond normal formThird normal form
34 Explain the different methods Learning Objective 4Explain the different methodsof accessing files.
36 Sequentially Accessed Files In a sequential access file, recordscan only be accessed intheir predefined sequence.Sequential file organization is usefulwhen batch processing is required.
37 Indexed Files An index file is one where an attribute has been extracted from the records and usedto build a new file whose purpose is toprovide an index to the original file.One important type of indexedfile is an indexed-sequential file.
38 Indexed Files An indexed-sequential file is a sequential file that is stored on a DASD and is both indexedand physically sorted on the same field.These files are frequentlyreferred to as ISAM files.
39 Indexed Files An ISAM file structurally consists of three distinct areas:The indexThe prime areaThe overflow areaHow would a computer locate a filerecord whose key is 1002?
40 Structure of an ISAM File Highest keyTrack index addressMaster Index15000300Track addressTrack IndexTrackaddress100503010300Highest keyon trackPrime AreaKeyDataTrackaddress1002Record found0301
41 Directly Accessed Files Direct-access files allow individualrecords to be almost instantly retrievedwithout the use of an index.Each record is assigned to a storagelocation that bears some relationshipto the record’s key values.Most direct-access file systems converta key to a storage location address.
42 Use of a Direct-Access File Processing logic flowchart:DatarecordsRandomizingcomputation(÷ 7)Addremainder todisplacementaddress (10)Filestoragearea
43 Use of a Direct-Access File File loading illustration:Remainderafterdivisionby sevenDisplacementfactor(initial addressof file area)KeyRecordstorageaddress134101517112221314+=Overflow
44 Use of a Direct-Access File Storage area contents after loading:Range ofrandomizingcomputationStorageallocated foroverflowrecords…Record 1 KEY 15*Record 2 KEY 17Record 3 KEY 11Record 4 KEY 22ContentsAddress101112131415161718Overflowindicator
45 Economic Relations between File Organization Techniques The basic economics of file processing arelargely determined by the activity ratio.What is the activity ratio?It is the number of accessed records dividedby the number of records in the file.The second economic considerationconcerns response time.
46 Economic Relations between File Organization Techniques What is response time?It is the length of time the user must waitfor the system to complete an operation.Response time is affectedby the physical access time.Another factor that can affect response time is howdata records are physically distributed on the disk.
47 Learning Objectives 5 and 6 Explain the benefitsof databasemanagement systems.Describe the considerationsthat are appropriate to thedesign of computer-basedfiles and databases.
48 Database Management Systems and Databases in Practice Database Management Systems (DBMS)are computer programs that enable a user tocreate and update files, to select and retrievedata, and to generate various outputs and reports.All DBMS contain three common attributesfor managing and organizing data.
49 Database Management Systems and Databases in Practice What are these attributes?Data description language (DDL)Data manipulation language (DML)Data query language (DQL)
50 Why Database Management Systems are Needed DBMS integrate, standardize, and providesecurity for various accounting applications.In the absence of integration, each type ofaccounting application such as sales, payroll,and receivables will maintain separate,independent data files and computer programs.
53 Database Documentation and Administration Database dictionaries are used both aloneand with DBMS to centralize, document,control, and coordinate the use of datawithin an organization.The data dictionary is simply another file,sort of file of files, whose record occurrencesconsist of data item descriptions.
54 Data Dictionary Format Items in a data dictionary occurrence:SpecificationsNameDefinitionAliasesCharacteristicsSizeRange of valuesEncodingEditing dataUtilizationOwnerWhere usedSecurity codeLast update