1.3.2 Databases Flashcards
Entity
Item of interest about which information is stored
Relational Database
Contains different tables for each entity
What is a Flat File?
Database that consists of a single file
What are flat files most likely based around?
A single entity and its attributes
How are flat files written out? Describe each part.
__Entity1__(Attribute1, Attribute2, Attribute3…)
What is a primary key?
A unique identifier for each record in a table.
How do we show the primary key?
By underlining it
Foreign Key
An attribute which links two tables together. The foreign key will exist in one table as the primary key, and act as the foreign key in the other.
How do we show the foreign key?
By using an asterisk
Secondary key
Allows a database to be searched quickly
ER Modelling
A visual way of describing data tables and the relationships between them.
They can be used to reduce redundancy and construct a relational database.
What are the three kinds of relationships in ER modelling?
One-to-one (eg Husband —- Wife)
One-to-many (eg Mother —< Children)
Many-to-many (eg Students >–< Courses)
Normalisation
The process of optimally designing data tables by reducing data redundancy and repetition by converting them into normal forms.
Benefits of normalisation [4]
- No redundancy
- Consistent data throughout linked tables
- Records can be added and removed without issues
- Complex queries can be carried out
What are the three types of normalisation?
First Normal Form
Second Normal Form
Third Normal Form
First Normal Form
- Each field contains a single value
- Each field contains the same data type
- No duplicate records
- All field names are unique
- Table must have a primary key
Second Normal Form
A table in 1NF that has no partial dependencies (data that repeats across multiple records removed and put into a new table with appropriate relationships)
Third Normal Form
A table in 2NF where all attributes that are not the primary key are fully dependent on the primary key (no non-key dependencies).
What is Indexing? What is it used to do?
- A method used to store the position of each record ordered by a certain attribute.
- This is used to look up and access data quickly.
Which key is automatically indexed?
Primary key
Do we typically use the primary key for queries? Why or why not?
No. The primary key is normally not remembered. Secondary keys are used. They are indexed to make the table easier and faster to search through on those particular attributes.
A bank needs to scan cheques. What data capturing method can they use?
Magnetic Ink Character Recognition. All the details on the cheque excluding the amount are printed in a special magnetic ink that can be recognised by the computer. The amount should be entered manually.
A school wants to automatically mark multiple choice questions. What data capturing method can they use?
Optical Mark Recognition
What are the four ways of capturing data to be entered into a database?
Manual.
Optical Mark Recognition
Optical Character Recognition
Magnetic Ink Character Recognition