1.3.2 Databases Flashcards
What is a Database
- An organised collection of data
- Databases are permanent, organised structures that hold vast amounts of data
Organising data into a database allows for easy:
- Adding
- Modification
- Deletion
- Searching
What are the benefits of using electronic databases
- Easier to retrieve, add, delete, update and modify data
- Easier to back up and make copies
- Can be accessed by multiple people at the same time and from different locations.
What are the different ways of capturing data
- Optical Character Recognition (OCR)
- Optical Mark Recognition (OMR)
- Barcodes and QR codes.
What is Optical Character Recognition
- Converts paper-based hardcopies into editable, digital versions of the same document.
- It reads text by interpreting the shape of the letters and puts the equivalent ASCII value in a digital file.
What is Optical Mark Recognition (OMR)
- Used for Multiple choice tests and collecting results of surveys.
- The user shades the box and the OMR scanner uses a light and places results in a database
- This reduces human error.
- What is an entity/file
- What is a row/tuple
- What is a column/attribute
- The data stored in the table
- The table contains records
- The table contains fields.
What is a Flat file database and an example of their use
- It contains only a single table
- Simple, quick to set up and store small amounts of data
- Can be ued for storing contact details
- Can be inefficient as they can develop data redundancy.
How do we solve the issues with flat file database
- We need to structure the data differently by creating a relational database.
- Split the information into multiple tables.
What is a Relational Database
- Made of smaller tables linked together using primary and foreign keys.
- This will remove redundancy but can be complex to create and maintain
What is data redundancy
- Simply means when lots of data is replicated
- This increases the amount of storage space required
Exam Question: Describe what is meant by a Primary Key
- A field that has a unique value / a unique identifier (1) for every record in that table (1)
- Usually ID numbers
- Using the primary key - can link 2 tables together
What is a foreign key
- Is any field in a table which is the primary key in another table.
- E.G Teacher ID is foreign in Students table but primary key in Staff table
What is a secondary key
- Is an additional key which can be used to search for a record in a database. It doesnt need to be unique to each record.
- Hard to remember student ID use surname instead - this is a secondary key.
What is Indexing
- An index is a data structure used to shorten the length of time it takes to search a database
- The index provides the position of each record according to its primary key.
- It maintains an index of primary keys
What is Normalisation
- Is the formal process of converting a flat-file database into a relational database.
- Each method is labelled according to the nature of their arrangement.
What are the 3 different types of database normalisation
- First Normal Form (1NF)
- Second Normal Form (2NF)
- Third Normal Form (3NF)
What are the different types of relationships
- 1:1 (one:one)
- 1:M (one to many)
- M:M (Many to many)
- We can use entity relationship diagrams.
Exam Question: Describe why Film Title is not a suitable Primary Key
Describe why film title would make a suitable secondary key
- A primary key must have a unique value for each record. However it is possible for 2 films to have the same name
- A secondary key is indexed allowing for faster searching and users are more likely to search by film.
What are the 4 ways of data and how to handle it
- Capturing: How do we get the database in the first place?
- Selecting: How do we query the data and retrieve it?
- Managing: How do we manage, manipulate, add, edit and delete data?
- Exchanging: How do we exchange the data with other people/systems
What do we use to Select data in a Database
- Structured Query Language
- Fast and efficient retrieval, deletion and manipulation of data using commands: SELECT, FROM, WHERE
How do you manage data in a database
- We need to be able to modify a database once it has been set up.
- Add new data, edit/modify data, delete data.
- Can achieve this via a database manipulation language (DML) like SQL using commands like; UPDATE, DELETE, INSERT