Chapter 13 - Chapter 13 We've talked about data files that...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
Chapter 13 We've talked about data files that contain documents (such as a word document), worksheets (excel document). This chapter discusses structured data files or database files - files that are organized in a uniform format. Examples: ? a file of employees for a company - name, address, job classification, hourly pay - for each employee. ? A telephone directory - name, address, phone number - for each entry. Tasks associated with maintaining and accessing the data in a data file are called data management. Each database file has a file structure that describes the way data are stored in the file. A database file is a collection of records. Each record contains the data for a particular entity - a person, place, or thing about which you want to store data. A record is subdivided into fields. The data contained in a field is called a data item. Example: Record for an employee entity: Field names data items Last name: Smith______ First name: William____ Address: ___________ Zip code: phone: Gender: SocNum JObCode DeptCode HourlyWage Exemptions Birthdate A field can be fixed-length or variable length. A fixed-length field has a maximum limit on the number of characters it can store. A data item with fewer characters is "padded" with blanks to fill the field. For example, if the last name field has a maximum length of 10, Smith would be stored as Smithbbbbb where each b is a blank. You can store last names with fewer than 10 characters but you cannot store names with more than 10 characters. A variable-length field expands to fit the data you store in it. Less common than fixed-length fields.
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Each field of a database file is assigned a data type which indicates the kind of data that can be stored in it. Numeric data types: real numbers and integers. Real numbers can contain decimal points, integers cannot. integer - exemptions real number - hourly wage Other data types: strings (last name, first name, address, zip code, etc. ) a string is a sequence of letter and/or digit characters. character data type- single characters - gender (F or M) - middle initial date data type - enables you to store and manipulate dates - 10/23/1996 is equivalent to October 23, 1996. Logical data type - used to store true/false or yes/no data. A memo data type or memo field - variable length text field in which you store a message or note. One reason we prefer fixed length fields is it gives us an exact count of the number of characters in a record. We can add up the characters in each field to come up with the record size (# of characters in a record). The record type is a general description of a record which includes its field names, data types, and field lengths. A record occurrence is the data stored for a particular entity in the database. A flat file is a data file in which all the records are the same record
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 10

Chapter 13 - Chapter 13 We've talked about data files that...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online