All databases contain at least one Table, Record and Field, these are 3 basic terms you should understand when getting started.
Table: A table is what holds the records, fields and defines the structure of the database. Record: A record is all of the data about one item. In the table above record one is all of the details about Mercedes Field: A field refers to each type of data held. In the table above an example of a field would be TeamName
Entities: An entities is a unique classification about data such as people, objects, places or events. Attributes: An attribute is a single item of data such as the 'Points' for 'Mercedes' in the table above [221]. Attributes could be all the details of the team in position 1, for example [1,Mercedes,Bottas,Hamilton,221].
If you were asked the question: What is the team name from the record in the second position? The answer would be 'Red Bull Racing'
WHAT IS A FLAT-FILE DATABASE
A flat file database is a database where all the records are stored in a single table. The databases above showing the 'F1 Constructors' table is a single flat file database. It has no other tables that it is connected to or has a relationship with. For a very basic and simple that is used by one or a small amount of people database a flat-file database be suitable.
DATA TYPES
The term 'Data Type' refers to the type of data used, for example it could be text, numbers, dates or time, boolean (Yes/No), Currency or an object such as an image or link. Each data type has its own data format, for example a data might be written DD/MM/YY or MM/DD/YY. Before setting up a database you will need to decide on data types and data formats for each field within your database. Once the data type and format for each field is set when you first create the database it should not be changed and it will restrict the data that is allowed to be entered, this then helps to ensure data integrity. Data integrity is the completeness, correctness or accuracy of data.
Imagine the problems that could occur if you did not defining the date data format when you set up the database. Giving the date 11th Jan 2021 as an example, an English person might enter this data as 11/01/21 an American person might enter this data as 01/11/21.
The list below shows some data types with example data formats. Text: Two options within the Text data type are short text and long text. Short text is used for under 256 characters to be entered, as standard most databases as set to short text, and you would need to specify long text at the set up stage if you want to change this. Note: numbers such as phone numbers are often set as text data types, this is because they start with a 0 (zero) which can cause problems for number fields. Exam Note: The data type of a phone number has been a popular examination question.
Numbers: Numbers can normally be formatted as integers, decimal, scientific.
Boolean: Boolean fields are used when you want to enforce one of two options for example YES or NO, ON or OFF, M or F, TRUE or FALSE, 1 or 0. Some database software may only allow 1 or 0 as options in the boolean datatype selection.
Date/Time: Data and time are often combined, and after selecting this as a data type you select the format. Time options may be 12 or 24 hour formats and then the format such as hh/mm/ss. Date option normally include the structure of the date such as DD/MM/YYYY.
Currency: Currency datatype will allow you to choose the currency used for example $ or £, it will also allow you to specify the number of decimal places.
Object: An object would normally be something that you cannot enter via the keyboard such as music or a picture, but you could also have items such as hyperlinks as objects.
What is a flat-file database and how does it differ from a relational database?
How is data stored in a flat-file database and what are the limitations of this type of database?
What are the advantages and disadvantages of using a flat-file database?
How is data retrieved from a flat-file database and how is it used in applications?
What are some examples of file formats that can be used to store data in a flat-file database?
Can a flat-file database be used for complex data analysis, and if so, how is this achieved?
KEY TERMS
TABLE: A table is what holds the records, fields and defines the structure of the database. RECORD: A record is all of the data about one item. In the table above record one is all of the details about Mercedes. FIELD: A field refers to each type of data held. In the table above an example of a field would be TeamName. ENTITIES: An entities is a unique classification about data such as people, objects, places or events. ATTRIBUTES: An attribute is a single item of data such as the 'Points' for 'Mercedes' in the table above [221]. Attributes could be all the details of the team in position 1, for example [1,Mercedes,Bottas,Hamilton,221]. DATA TYPE: The type of data used, for example it could be text, numbers, dates or time, boolean. FLAT-FILE DATABASE: A flat file database is a database where all the records are stored in a single table.