Data Heirarchy and Data File Structure
Data Heirarchy and Data File Structure
Data Hierarchy
• A computer system organizes data in a hierarchy that starts with bits and bytes and
progresses to fields, records and databases.
• BIT- Bit is the smallest unit of data a computer can handle. The term “bit” is short form for
binary digit. It can assume either of two possible
• BYTE- a group of BITS is called a byte, represents a single character, which can be a letter, a
number or a symbol.
• A byte of information is stored by using several bits in specified combination called “bit
patterns.” A widely used bit pattern for personal computers and data communication is the
American Standard Code for Information Interchange (ASCII).
FIELD-
• The next level in data hierarchy is a field or item of data. A field or item of data is one or
more bytes containing data about the attribute of an entity in an information system.
• A group of characters into words, a group of words, or a complete numbers( such as persons
name or age.) is called a field.
Data Record-
• A group of related fields, such as the student’s name, the course taken, the date and the
grade, comprises a record.
• A record is a collection of fields relating to a specific entity. For example, a payroll record
contains fields of data relating to a specific employee.
File-
• A file is a collection of related records. For example, the collection of payroll records of all
employees in a company is a payroll file. The concept of a computer file is very similar to a
manual file in a filing cabinet.
Hierarchy of Data
Hierarchy of Data
-is the presence of duplicate data in multiple data files so that the same data are stored in
more than one place.
Program-data dependence
-program data dependence refers to the coupling of data stored in files such that changes in
program require change in data.
Lack of flexibility
Poor security
Lack of data sharing and availability.
The integrity of the information stored in databases are controlled by the keys.
A key or key field is a column is used to either uniquely identify a row of a data in a table, or
establish a relationship with another table.
Different types of Keys are Primary key, Foreign key, and candidate key.
Primary key
It denotes the key that is primarily chosen by the database designer as the principal means
of uniquely identifying records within the table.
The primary key should be chosen in such a way that its value must not change.
Records can be uniquely identified by this key for easy retrieval, updated or sorted.
Foreign Keys.
A foreign key is a combination of one or more columns in a table that references a primary
key in another table.
Candidate key-
A combination of one-or more fields whose value uniquely identifies a record in a table, that
is , no two records in the table can have the same key value.
Alternate key
Composite key
Secondary key
Logical data concepts
Entity
An entity is an object that has its existence in the real world. It contains all the things about
which the data is collected.
Attribute
Attributes are units that describe the characteristics or properties of entities.in a database ,
entities are represented by tables and attributes by columns.
Relationships
Name
Degree
Cardinality
File operations:
The fundamental operations that can be performed on files are the following:
Creation of a file.
Modification of records .
File Organization
• The way the data is stored and organized in a storage medium is called file organization.
• The physical organization of data on backing storage device (e.g magnetic disks) can be
defined as the relationships between the values of the key field on consecutive records and
the position of the storage device.
• There are several different ways in which files are organized ,and for each, a separate
method of accessing the records must be defined.
• Sequential file organization are suitable for most master files in a normal batch processing
environment where all or most of the records have to be processed.
• The desired record can be identified by relative track number and the relative record
number.
• The records can be identified by the physical address. These files are called dynamic files or
direct files.
The computer can directly locate the key to find out the record without having to search
through any other records first. For example, employee records could be accessed by using
the employees number assigned to them.