Presentation is loading. Please wait.

Presentation is loading. Please wait.

Chapter Eight Managing Data Resources File Organization and Concepts.

Similar presentations


Presentation on theme: "Chapter Eight Managing Data Resources File Organization and Concepts."— Presentation transcript:

1

2 Chapter Eight Managing Data Resources

3 File Organization and Concepts

4 File Organization Terms Field - a grouping a characters into a word, a group of words, or a complete number, such as a person’s name and age. (Key field - uniquely identifies) Record - A group of related fields. File - a group of records of the same type Entity -a person, place,thing, or event about which information must be kept Attribute - A piece of information describing a particular entity.

5 Illustration of a Record

6 Accessing Records from Computer Files Sequential File Organization –a method of storing data records in which the records must be retrieved in the same physical sequence in which they are stored Direct/Random File Organization –a method of storing data records in a file so that they can be accessed in any sequence without regard to their actual physical order on the storage media

7 Data Access Methods Indexed Sequential Access Method –a file access method to directly access records organized sequentially using an index of key fields Direct File Access Method- –a method of accessing records by mathematically transforming the key fields into specific addresses for the records Transform Algorithm –a mathematical formula used to translate a record’s key field directly into the record’s direct physical storage location

8 Indexed Sequential Access Method

9 Direct File Access Method Basically uses an algorithm within a disk stack to access the record Example - File Size -1000 records –take the prime number closet to the max number of records (in this case 997), divide the key field number by this prime number and the remainder is the address location number.

10 A Disk Stack Access mechanism 10 Access arms 11 disks 000403 404 Tracks 20 Read/write heads 20 Tracks

11 2 0 907003 Track number Read/write head number Record number A DASD Address

12 Traditional File Environment A way of collecting and maintaining data in an organization that leads to each functional area or division creating its own data files and programs. Can be either flat or data approached. Problems with TFE –data redundancy, program data dependence, inflexibility, poor data security, inability to share

13 SALES NO 112 128 153 159 162 166 NAME ADAMS WINKLER HOUSE FRANCIS WILLIS GROVETON SALES NO 112 128 153 159 162 166 TERR 132112132112 An Example of Two Flat Files Table ATable B

14 Problems with TFE Explained Data Redundancy –presence of duplicate data in multiple data files Program-Data Dependence –the close relationship between data and programs. Any update in the data requires a format change within the software (ZIP/AREA CODE ex) Inflexibility - cannot produce custom reports Security - with little control of data, hard to control access Data sharing - with data in many places hard to share b/c you do not know where it is

15 The Database Concept Database definition An integrated collection of computer data, organized and stored in a manner that facilitates easy retrieval. Data independence -- keep data specifications separate from programs, in tables and indexes

16 Database Management System(DBMS) The special software to create and maintain a database and enable individual business applications to extract the data they need without having to create separate files or data definitions in their computer programs –a DBMS has three components –a data definition language –a data manipulation language –a data dictionary

17 Hierarchical Database Custormers KathyCindyDebra Dog food Cat food Bird food Dog food Bird food.. Customer Order

18 Network Database Custormers KathyCindyDebra Dog food Cat food Bird food Dog food Bird food.. Customer Order Dog Food

19 Relational Database Table format Easy access (query) Customer(CustomerID, Name, OrderID,…) Order(OrderID, CustomerID, OrderDate,…) ItemsOrdered(OrderID, ItemID, Quantity) Customer CustomerID Name.. Order OrderID.. … ItemsOrdered OrderID..

20 Database Differences

21 Design a database Sally’s Pet Store Supplier Employee CustomerSale Animal

22 The Pet store’s Database Name AnimalID Category Breed Dateborn Gender Color Cathy 123 Bird Lovebird 6/5/98 Male Yellow Terry 353 dog Canary 7/1/97 Female Red Sandy 345 dog African 8/5/98 Male Yellow Charles 232 Bird Parrot 4/6/99 Male Yellow Ruby 565 dog Other 6/4/99 Male Yellow Curtis 675 cat Grey 8/5/98 Male Grey Employee Name Soc.Sec.No Address Salary AnimalID Daniel 232423435 ….. $23000 123 ……… ……… …… Animal

23 Structural Query Language (SQL) SELECT columns Which property do you want ? FROM tables What tables are involved? JOIN conditions How are the table joined? WHERE criteria What are the constraints? Four basic commands: SELECT AnimalID, Category, Dateborn FROM Animal WHERE ((Category=“Dog”) AND (Dateborn>#6/1/98#));

24 Query Resulting table: AnimalID Category Dateborn 345 dog 8/5/98 565 dog 6/4/99 SELECT Name, AnimalID, Salary FROM Employee WHERE (AnimalID=#123#)

25 SQL(2) List all birds who are male or who are born before 6/1/98 and have red in their color SELECT AnimalID, Category, Gender, Dateborn, Color FROM Animal WHERE (((Category=“Bird”) AND (Gender=“Male”)) OR ((Dateborn<#6/1/98#) AND (Color Like “*Red*”)))

26 Back to Database Design The main idea is to separate all the 1 to many relationships. –Look at page 243, or to your access quiz for examples Each table holds specific information that is tied to the other tables through ‘keys’ and relationships this process is referred to as normalization

27 Normalization Why? –To prevent anomalies - occurrences in the database that result from inefficient database structure. They also cause harmful events that can change or erase data. There are three types of anomalies –insertion –deletion –modification

28 Insertion anomalies Refers to the inability to add data to the database because the tables are not referenced correctly. This is to say if we want to add a new element we would have to add to numerous tables, and failure to do so would cause inconsistent data.ex. The inability to enter a new employee w/o adding in multiple tables.

29 Deletion Anomalies This is the opposite of the insertion anomaly. When items are not referenced correctly we can lose information. Ex. We have an employee database that does not have a separate department database, if we delete that employee we will lose that dept. info.

30 Modification Anomalies This occurs when you can change the value of one of the attributes (columns) of a dept, but that data is not changed throughout the database, unless we go in and manually change each table.

31 Other Database Concepts Databases on the web –technology makes this really easy to do –the gsc examplethe gsc example –makes for more efficient transfer of data as well as collection, with db security we can have EDI which is the underlying foundation of Electronic Commerce –related to Online Analytical Processing (OLAP) see book for example

32 Mgmt Requirements for DB Systems Data administration- this is the definition of information requirements and access –usually formulated into a information policy Data Planning and modeling - the actual database formation process, what are ‘keys’, attributes, and relationships database administration users- the idea of making your database useable by all employees, plus support

33 Database Administration Defines and organizes database structure and content develops security procedures to safeguard the database develops database documentation maintains the database mgmt. software

34 Other terms to look up and know Distributed database data warehouse datamart


Download ppt "Chapter Eight Managing Data Resources File Organization and Concepts."

Similar presentations


Ads by Google