1 / 34

Chapter Eight

Chapter Eight. Managing Data Resources. File Organization and Concepts. 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.

Download Presentation

Chapter Eight

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Chapter Eight Managing Data Resources

  2. File Organization and Concepts

  3. 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.

  4. Illustration of a Record

  5. 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

  6. 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

  7. Indexed Sequential Access Method

  8. 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.

  9. A Disk Stack Access mechanism 10 Access arms 404 Tracks 11 disks 000 403 20 Read/write heads 20 Tracks

  10. A DASD Address 0 2 9 0 7 0 0 3 Track number Read/write head number Record number

  11. 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

  12. SALES NO TERR SALES NO NAME 112 128 153 159 162 166 1 3 2 1 1 2 112 128 153 159 162 166 ADAMS WINKLER HOUSE FRANCIS WILLIS GROVETON An Example of Two Flat Files Table A Table B

  13. 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

  14. 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

  15. 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

  16. Hierarchical Database Custormers Customer Kathy Cindy Debra Order Dog food Cat food Bird food Dog food Bird food .. ..

  17. Custormers Customer Kathy Cindy Debra Order Dog food Cat food Bird food Dog food Bird food .. .. Network Database Dog Food

  18. 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 .. ..

  19. Database Differences

  20. Designa database Sally’s Pet Store Animal Sale Customer Supplier Employee

  21. The Pet store’s Database Animal 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 ……… ……… ……

  22. 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#));

  23. 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#)

  24. 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*”)))

  25. 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

  26. 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

  27. 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.

  28. 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.

  29. 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.

  30. Other Database Concepts • Databases on the web • technology makes this really easy to do • the 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

  31. 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

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

  33. Other terms to look up and know • Distributed database • data warehouse • datamart

More Related