COMPUTER SCIENCE - DATA BASES - CHAPTER 14 / 2.3 (DATABASE STRUCTURES…
COMPUTER SCIENCE - DATA BASES - CHAPTER 14 / 2.3
A database is a collection of data stored in a logical and order manner. Databases can be either paper-based or electronic.
Data - raw facts and figures.
Can be used for: medical records, website history, TV channel list and library book information.
Advantages - data can be easily sorted in a specific way, for example alphabetically; quick to find data; data can be filtered to retrieve only required data; allows easy sharing of data, for example over the internet or storage devices; validations can make sure data is possible, realistic and sensible; backups can be easily made; and saves space compared to paper-based
All databases have a structure that allows the data held within them to be stored in a logical and orderly manner.
Data is stored in tables consisting of records and fields.
Table - a structure in which data is stored in a database.
Flat file database - a database whose records are stored in a single table.
Record - a collection of data about one single item in a database (row).
Field - one piece of data about an item in a database (column).
Data type is the format of the data in a field. each database field must be given a data type.
Tables need a primary key, which is a field that holds data that uniquely identifies a record. The primary key is usually the first field, is the field that contains the index for each record, can be a number.
Index - a list of values or items.
A database that has several tables linked by primary key fields. More complex in structure.
Foreign key - a primary key that appears in another table in a relational database.
Advantages - data only needs to be entered once, but it can be used repeatedly within the database; entering data only once reduces the chance of data errors; if a data entry error has occurred the data only has to be corrected once
Query - a method of searching a database for specific data.
SQL is a programming language that is used to maintain databases and to create queries.
A common method of searching a database is using a query by example, which is a method of searching a database by stating the criteria to be searched. This needs to include: the table, the field, the criteria, any sorting that we want to apply, if we require the field to appear in the results or not.
Criteria - a principle or standard by which something may be judged or decided. For example, only looking at data more than 3 in a certain field.
Data held within a database is only of use if it is reliable. Unreliable data can lead to serious consequences for users.
Data validation is the process of automatically checking whether data entered is possible, realistic and sensible. Incorrect data can still be entered.