Databases Flashcards
What is a Relational Database
A database where data is held in tables (relations) and the tables are linked by common attributes
What is a Flat File
A database that consists of a single file. The flat file will most likely be based around a single entity and its attributes
What are the potential problems of using a flat file database
- Data might be inconsistent since data changed in one record may not be changed in another
- Space is wasted through repeated data
What is an Entity
An item of interest
What are the three types of keys
- Primary Key
- Secondry Key
- Foreign Key
What is a Primary Key
A primary key is a unique identifier for each record in the table
What a Secondary Key
- A secondary key allows a database to be searched quickly
- For example, secondary key can be set up on the surname attribute as it is unlikely someone will remember their ID but will remeber their surname it makes it easier to find specific people in the database
What is a Foreign Key
- A foreign key is the 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 another
What is the name given to a key that is made up of multiple attributes
Composite key
What are the three Entity Relationship Models
- One-to-one- each entity can only be linked to one other entity, such as the relationship between a husband and wife
- One-to-many - one table can be associated with many other tables, such as a doctor having multiple patients
- Many-to-many - one entity can be associated with many other entities and the same applies the other way round. An example is customers and products - each customer can have more than one product and each product can have more than one customer

What is Normalisation
The process of coming up with the best possible layout for a relational database
What does Normalisation try to achieve
- No redundancy (unnecessary duplicates)
- Consistent data throughout linked tables
- Records can be added and removed without issues
- Complex queries can be carried out
What is First Normal Form
- No repeating fields / data
- Each record has a primary key
- Field names should only contain a single value
What is Second Normal Form
- No partial dependencies (one or more fields is depedent on only part of the primay key)
- The data must be in first normal form
What is Third Nomalisation form
- Contains no non-key dependencies (A non-key dependency means the attribute only depends on the value of the primary key and nothing else)
- The data must be in second normal form
What is Indexing
- A method of numbering the position of each record in a database
- This is used to look up and access data quickly
What does capturing data mean and give examples
- The process of getting the data that will be stored in a database
- Manual methods include transcribing data from a form that has been filled in
- Banks scan cheques using Magnetic Ink Character Recognition (MICR). All of the details excluding the amount are printed in a special magnetic ink which can be recognised by a computer but the amount must be entered manually
- Optical Mark Recognition (OMR) is used for multiple choice questions on a test.
- Other forms use Optical Character Recognition (OCR).
What does selecting and managing data mean and give an example
- Selecting data involves only selecting data that fits a certain criteria to reduce the volume of input
- For example, a camera catching speeding cars will only select cars going above a certain speed. Then, background information will be removed so only the number plate is added to a record.
What does exchanging data mean and give an example
- The process of transferring collected data
- One common way of exchanging data is EDI (Electronic Data Interchange). This doesn’t require human interaction and enables data transfer from one computer to another
What are the eight types of SQL operations
- SELECT – finds data
- INSERT – adds data
- UPDATE – changes data
- DELETE – deletes records from a Table
- DROPS - drops an entire table
- Inner Join - selects records with matching values in both tables
- Order by - sorts the data in ascending or descending order
- * or ‘% - wildcards
What is the general form for a SQL SELECT operation
SELECT
FROM
WHERE
What is the general form for a SQL UPDATE operation
UPDATE
SET
WHERE
What is the general form of an SQL INSERT operation
- INSERT INTO
- VALUES
What is the general form for a SQL DELETE operation
DELETE
FROM
WHERE