1.10 Databases Flashcards

1
Q

Relational Databases

A
  • Entity: Item of interest about which information is stored
  • Relational Database: Database which recognises the differences between entities by creating different tables for each entity
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Flat File

A

Flat File: Database that consists of a single file. Used for a single entity and its attributes
- E.g Car(CarID, Age, Price)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Primary Key

A

Primary Key: Unique identifier for each record in the table
- E.g CarID

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Foreign Key

A

Foreign Key: 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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Secondary Key

A

Secondary Key: Allows a database to be searched quickly
- Secondary key set up (E.g surname) making it possible to order & search by surname which makes it easier to find specific items in the database

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Entity Relationship Modelling

A

Tables can have different kinds of relationships, which depend on how entities are related in the real world:

  • One-to-one: Each entity can only be linked to one other entity, E.g husband & wife
  • One-to-many: One table can be associated with many other tables, E.g mother having multiple children. Multiple child entities can be linked to the same mother entity
  • Many-to-many: One entity can be associated with many other entities and the same applies the other way round, E.g students and courses
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Normalisation

A

Normalisation: Process of coming up with the best possible layout for a relational database

  • No redundancy (unnecessary duplicates)
  • Consistent data throughout linked tables
  • Records can be added and removed without issues
  • Complex queries can be carried out
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Types Of Normalisation

A

First Normal Form: There must be no attribute that contains more than a single value.

Second Normal Form: A database which doesn’t have any partial dependencies & is in 1NF can be said to be in 2NF. No attributes can depend on part of a composite key

Third Normal Form: If the database is in second normal form & contains no non-key dependencies, it is in 3NF. A non-key dependency means the attribute only depends on the value of the primary key & nothing else.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Indexing

A

Indexing: Method used to store the position of each record ordered by a certain attribute. Used to look up & access data quickly
- The primary key is automatically indexed, but primary key is almost never queried since it is not normally remembered
- This is why secondary keys are used & indexed making table easier & faster to search through on those particular attributes

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Capturing Data

A
  • Data capturing method dependent on the context
  • E.g pedestrians in a survey, responses manually entered into database
  • When people pay cheques. Banks scan cheques using Magnetic Ink Character Recognition (MICR)
  • Optical Mark Recognition (OMR) is used for multiple choice questions on a test
  • Optical Character Recognition (OCR)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Selecting & Manging Data

A
  • Selecting the correct data is an important part of data preprocessing
  • Involves only selecting data that fits a certain criteria to reduce the volume of input
  • E,g background information will be removed so only the number plate is added to a record
  • Collected data can also be managed using SQL to sort, restructure & select certain sections
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Exchanging Data

A

EDI (Electronic Data Interchange): Doesn’t require human interaction & enables data transfer from one computer to another

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

SQL

A

Structured Query Language: Declarative language used to manipulate databases. Enables the creating, removing and updating of databases

SELECT: Used to collect fields from a given table
FROM: Specifies which table(s) the information will come from
WHERE: Specifies the search criteria
ORDER BY: Specifies whether you want it in ascending/ descending. Automatically Ascending, Add ‘Desc’ to the end
JOIN: Method of combining rows from multiple tables based on a common field between them
ALTER: Used to add, delete or modify the columns in a table
INSERT INTO: Used to insert a new record into a database table
UPDATE: Used to update a record in a database table
DELETE: Used to delete a record from a database table

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Data Types

A
  • CHAR(n): this is a string of fixed length n
  • VARCHAR(n): this is a string of variable length with upper limit n
  • BOOLEAN: TRUE or FALSE values
  • INTEGER/INT: integer
  • FLOAT: number with a floating decimal point
  • DATE: the date in the format Day/Month/Year
  • TIME: the time in the format Hour/Minute/Second
  • CURRENCY: sets the number as a monetary amount
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Referential Integrity

A

Referential Integrity: Process of ensuring consistency. This ensures that information is not removed if it is required elsewhere in a linked database
E.g If 2 database tables are linked, 1 of these tables cannot be deleted as the other table requires its contents

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

ACID

A

Transaction: A single operation executed on data

ACID (Atomicity, Consistency, Isolation, Durability)
- Atomicity: Transaction must be processed in its entirety or not at all
- Consistency: Transaction must maintain the referential integrity rules between linked tables,
- Isolation: Simultaneous executions of transactions should lead to the same result as if they were executed one after the other
- Durability: Once a transaction has been executed it will remain so regardless of the circumstances surrounding it, e.g power cut

17
Q

Record Locking

A

Record Locking: The process of preventing simultaneous access to records in a database
- Used in order to prevent inconsistencies or a loss of updates
- While one person is editing a record, this ‘locks’ the record so prevents others from accessing the same record

18
Q

Redundancy

A

Redundancy: Process of having one or more copies of the data in physically different locations
- Some information is very important and people & companies cannot afford to lose this information
- If there is any damage to one copy the others will remain unaffected & can be recovered.