1.3.2 Databases

0.0(0)
studied byStudied by 2 people
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/39

flashcard set

Earn XP

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

40 Terms

1
New cards

Database

Simplest kind is a flat file, consisting of information about a single entity

2
New cards

Entity

A category of object, person, event or thing of interest about which data needs to be recorded

3
New cards

Relational databases

A database which recognises the difference between entities (item of interest about which information is stored) by creating different tables for each entity

4
New cards

Attributes

Characteristics of entities - categories about which data is collected

5
New cards

Flat file database

Database that consists of a single file. Most likely based around a single entity and its attributes. Typically written out as: Entity1(Attribute1, Attribute2, Attribute3 …)

6
New cards

Primary key

Unique identifier for each record in the table that is automatically indexed. Primary key is shown by underling it

7
New cards

Composite Primary Key

Sometimes two or more attributes are needed to uniquely define a record

8
New cards

Foreign key

The attribute which links two tables together. Will exist in one table as the primary key and act as the foreign key in another. Shown using an asterisk

9
New cards

Secondary key

Allows a database to be searched quickly

10
New cards

Entity relationship modelling

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

11
New cards

One-to-one entity relationship

Each entity can only be linked to one other entity, such as the relationship between a husband and wife

12
New cards

One-to-many entity relationship

One entity can be associated with many other entities, such as a mother having multiple children

13
New cards

Many-to-many entity relationship

One entity can be associated with many other entities and the same applies the other way round, such as students and courses - each student can enrol in more than one course and each course can have more than one student

14
New cards

Relationship modelling

knowt flashcard image
15
New cards

Normalisation

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

16
New cards

What does normalisation try to accomplish?

No redundancy (unnecessary duplicates)

Consistent data

Records can be added and removed without issues

Complex queries can be carried out

17
New cards

First normal form

There must be no attribute that contains more than a single value. No repeating groups of attributes

18
New cards

Second normal form

Database which doesn’t have any partial dependencies and is in first normal form can be said to be in second normal form. This can only occur if the primary key is a composite key

19
New cards

Third normal form

If the database is in second normal form and contains no non-key dependencies, it’s in third normal form. A non-key dependency means the attribute only depends on the value of the primary key and nothing else

20
New cards

Indexing

Method used to store the position of each record ordered by a certain attribute. Used to look up and access data quickly. Primary key is automatically indexed; however is almost never queried since it’s not normally remembered. Secondary keys are used to make the table easier and faster to search through on those particular attributes

21
New cards

Capturing data

Data can be input into the database using multiple methods depending on the context, such as Magnetic Ink Character Recognition, Optical Mark Recognition, or Optical Character Recognition

22
New cards

Selecting and managing data

Could involve only selecting data that first a certain criteria to reduce the volume of input. Can alternatively be managed using SQL

23
New cards

Exchanging Data

The process of transferring the collected data

24
New cards

SQL

Structured Query Language:

A declarative language used to manipulate databases

25
New cards

SELECT, FROM, WHERE

SELECT is used to collect fields from a given table and can be paired with FROM to specify which table the information will come from. WHERE can be used to specify the search criteria

26
New cards

ORDER BY

Specifies whether you want it in ascending or descending order. Values are automatically placed in ascending order

27
New cards

JOIN

Provides a method of combining rows from multiple tables based on a common field between them

28
New cards

CREATE

Allows you to make new databases

29
New cards

ALTER

Used to add, delete or modify the columns in a table

30
New cards

INSERT INTO

Used to insert a new record into a database table

31
New cards

UPDATE

Used to update a record in a database table

32
New cards

DELETE

Used to delete a record from a database table

33
New cards

Referential Integrity

The process of ensuring consistency. Ensures information is not removed if it is required elsewhere in a linked database and that no foreign key in one table can reference a non-existent record in a related table

34
New cards

Transaction

A single operation executed on data

35
New cards

ACID (Atomicity, Consistency, Isolation, Durability)

Atomicity: Transaction must be processed in its entirety or not at all

Consistency: Transaction must maintain referential integrity rules between linked tables

Isolation: Simultaneous executions of transaction should lead to the same result

Durability: Once a transaction has been executed it will remain so

36
New cards

Record Locking

Process of preventing simultaneous access to records in a database. Used to prevent inconsistencies or loss of updates. While one person is editing a record it ‘locks’ it to prevent others from accessing the same record

37
New cards

Problems with Record Locking

If two users attempt to update two records a situation can arise where neither can proceed, this is a deadlock

38
New cards

Timestamp Ordering

Deadlock prevention. When a user tries to save an update, if the read timestamp is not the same as it was when they started the transaction then another user has accessed the same object.

39
New cards

Commitment Ordering

Deadlock prevention. Transactions are ordered in terms of their dependencies on one another as well as the time they were initiated. Can be used by blocking one request until another is completed

40
New cards

Redundancy

The process of having one or more copies of the data in physically different location