Not a premium member yet? Save 100's of hours on lesson prep with a comprehensive library of GCSE Computer Science resources - including worksheets, tests, and PowerPoint presentations.
Download the complete GCSE Computer Science bundle including all teacher resources and student revision:
- 200+ Computer Science/ICT resources
+ any we release in the future!
- Access to all student revision notes
- OCR, AQA, Edexcel and WJEC compatible
- New 9-1 GCSE spec
A database field is a set of data values, of the same data type, in a table. It is also referred to as a column or an attribute.
Most databases also allow fields to hold complex data like pictures, whole files, or even movie clips. A field that allows same data type does not mean it only has simple text values. Some databases allow the data to be stored as a file on the Operating System, while the field data only contains a pointer or link to the actual file.
This is done to keep the database size manageable since smaller database size means less time for backups and for searching data within the database.
A simple example is a table that saves employee’s job record. The fields in this table can be the following: Employee ID, Last Name, First Name, Position, Department and Hire Date.
|Employee ID||Last Name||First Name||Position||Department||Hire Date|
|00108||Doe||John||Assistant Manager||Human Resources||November 16, 2000|
|00109||Parker||Anne||Supervisor||Financial Services||May 1, 2003|
Required, Optional and Calculated Fields
In database management systems, a field can either be required or mandatory, optional or calculated. A required field is a field where you must enter data. It is mandatory to enter data else you’ll get an error message. An optional field is a field where you may either enter data or leave blank; leaving it blank does not result to an error message.
A calculated field is a field where the value is a result of some formula concerning other fields. There’s no need to enter data into a calculated field; the system automatically computes for provides the correct value.
In an employee job record, hire date is a required field while religion can be an optional field. Tenure is a calculated field derived from hire date and current date.
Fields and Records
Fields are arranged into records, which hold all the information within the table related to a specific entity. The records make up the table rows while the fields make up the table columns.
Fixed Length and Variable Length Fields
Fixed length fields hold a fixed number of bits. A drawback of utilising fixed length fields is that some parts may be unused, but it is still required to put spaces for the maximum length case. Also, in cases where fields are deleted, padding for the missing fields is still required to preserve fixed start positions within a record.
Each database has its own database field types. Here are some common database field types, which are called in different names per database design:
- Text, Alphanumeric, Character, String
- Short, Integer
- Long, Integer
- Single, Real
- Double, Float
- DateTime, TimeStamp
- LongText, LongChar, Memo, Note