A field is the physical implementation of a data attribute. Fields are the smallest unit of meaningful data to be stored in file or database. There are 3 types of fields that can be stored : primary keys, secondary keys, foreign key, and descriptive fields.
A primary keys is a field whose values identify one and only one record in a data entity. For e.g., customer—Id uniquely identifies a single CUSTOMER record in a database.
A secondary key is an alternate identifiers for a database. A secondary key’s values may identify either a single record or a subset of all records. A single file in a database may have only one primary key, but it may have several secondary keys.
Foreign keys are pointers to the records of a different file in a ddtabase. Foreign keys enable the database to link the records of one type of those of another types.
For e.g., an ORDER RECORD contains the foreign key customer—Id to ‘identify’ or `point to’ the customer record that is associated with the ORDER.
Fields are organized into records. Records are common to both files and databases. A record is a collection of fields arranged in a predefined format.
During system design, records will be classified as either fixed length or variable length records.
Most database technologies impose a fixed-length record structure, meaning that each record instance has the same fields, same number of fields, and same logical size.
Variable record structure allow different records in the same file to have different lengths.
FILES AND TABLES
In database systems, A file is a set of all occurrence of a given record structure. A table is the relational database equivalent of a file. Some types of conventional files and tables are :
- Master Files : or tables contains records that are relatively permanent. Thus, once a record has been added to a master file, it remains in the system The values of fields for the record will change over its lifetime, but the individual records are retained indefinitely.
- Transaction Files : or tables contain records that describe business events. The data describing these events normally has a limited useful lifetime. In information system, transaction records are frequently retained online for some period of time.
- Document Files : and tables contains stored copies of historical data for easy retrieval and review without the overhead of regenerating the document.
- Archival Files : and tables contains master and transaction file records that have been deleted from online storage. Thus, records are rarely deleted, they are merely moved from online storage to offline storage.
- Audit Files : are special records of updates of other files, especially master and transaction files., Audit trails are built into better database technologies.