Section Four: Exchanging data Flashcards

You may prefer our related Brainscape-certified flashcards:
1
Q

Chapter 15 – Compression, encryption and hashing
What is compression?

A

Compression is a technique that reduces file size. Some compression techniques are referred to as lossy, because they cause data to be lost during the compression process. Other techniques are referred to as lossless, because they allow the original data to be exactly reconstructed from the compressed data

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

Chapter 15 – Compression, encryption and hashing
What is lossy compression?

A

Lossy compression is a term used to describe compression techniques that always result in a loss of data, i.e. data is permanently removed from the file. When the file is decompressed, the data that was removed (in the compression process) is re-created from the data that remains in the file.

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

Chapter 15 – Compression, encryption and hashing
What is lossless compression?

A

Lossless compression restores and rebuilds file data in its original form after the file is decompressed. For example, when a picture’s file size is compressed, its quality remains the same. The file can be decompressed to its original quality without any loss of data.

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

Chapter 15 – Compression, encryption and hashing
What is a Run Length Encoding (RLE)?

A

Run length encoding (RLE) is a lossless compression technique. It works by finding runs of repeated binary patterns and replacing them with a single instance of the pattern and a number that specifies how many times the pattern is repeated.

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

Chapter 15 – Compression, encryption and hashing
Dictionary-based compression techniques

A

Dictionary-based compression is another lossless technique that relies on finding patterns in data. However, it does not look for repeated runs of characters, as the repetitions do not need to be adjacent to each other. Instead of storing the pattern itself, a shorter code is substituted.

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

Chapter 15 – Compression, encryption and hashing
Encryption

A

Encryption is the transformation of data from one form to another to prevent an unauthorised third party from being able to understand it. The original data or message is known as plaintext. The encrypted data is known as ciphertext. The encryption method or algorithm is known as the cipher, and the secret information to lock or unlock the message is known as a key.

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

Chapter 15 – Compression, encryption and hashing
The Caesar cipher

A

The Caesar cipher (also known as a shift cipher) is a type of substitution cipher and works by shifting the letters of the alphabet along by a given number of characters; this parameter being the key. Below is an example of a shift cipher using a key of 5.

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

Chapter 15 – Compression, encryption and hashing
The Vernam cipher

A

The Vernam cipher, invented in 1917 by the American scientist Gilbert Vernam, is the only cipher still proven to be unbreakable. All others are based on computational security and are theoretically discoverable given enough time, ciphertext and computational power.

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

Chapter 15 – Compression, encryption and hashing
One-time pad

A

The encryption key or one-time pad must be equal to or longer in characters than the plaintext, be truly random and be used only once. One-time pads are used in pairs where the sender and recipient are both party to the key. Both must meet in person to securely share the key and destroy it after encryption or decryption. Since the key is random, so will be the distribution of the characters meaning that no amount of cryptanalysis will produce any meaningful results.

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

Chapter 15 – Compression, encryption and hashing
The bitwise exclusive or XOR

A

An XOR operation is carried out between the binary character value of the first character of the plaintext and the first character of the one-time pad.

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

Chapter 15 – Compression, encryption and hashing
Cryptanalysis and perfect security

A

Other ciphers that use non-random keys are open to a cryptanalytic attack and can be solved given enough time and resources. Even ciphers that use a computer generated random key can be broken since mathematically generated random numbers are not actually random; they just appear to be random.

A truly random sequence must be collected from a physical and unpredictable phenomenon such as white noise, the timing of a hard disk read/write head or radioactive decay. Only a truly random key can be used with a Vernam cipher to ensure it is mathematically impossible to break.

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

Chapter 15 – Compression, encryption and hashing
Symmetric (private key) encryption

A

Symmetric encryption, also known as private key encryption, uses the same key to encrypt and decrypt data. This means that the key must also be transferred (known as key exchange) to the same destination as the ciphertext, which causes obvious security problems. The key can be intercepted as easily as the ciphertext message to decrypt the data. For this reason asymmetric encryption can be used instead.

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

Chapter 15 – Compression, encryption and hashing
Asymmetric (public key) encryption

A

Asymmetric encryption uses two separate, but related keys. One key, known as the public key, is made public so that others wishing to send you data can use this to encrypt the data. This public key cannot decrypt data. Another private key is known only by you and only this can be used to decrypt the data.

It is virtually impossible to deduce the private key from the public key. It is possible that a message could be encrypted using your own public key and sent to you by a malicious third party impersonating a trusted individual. To prevent this, a message can be digitally ‘signed’ to authenticate the sender.

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

Chapter 15 – Compression, encryption and hashing
Hashing

A

A hashing function provides a mapping between an arbitrary length input and a usually fixed length or smaller output. Unlike the encryption techniques described above, it is one-way; you cannot get back to the original. This is useful for storing encrypted PINs and passwords so that they cannot be read by a hacker. To verify a user’s password, the software applies the hash function to the user input and compares it with the one stored.

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

Chapter 15 – Compression, encryption and hashing
Cryptographic hash functions

A

A hash total is a mathematical value calculated from unencrypted message data. This value is also referred to as a checksum or digest. The process is irreversible and impossible to crack other than by trying all of the possible inputs until a match is found. Since the hash total is generated from the entire message, even the slightest change in the message will produce a different total.

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

Chapter 15 – Compression, encryption and hashing
Digital signatures

A

A digital signature is a way to ensure that an electronic message or document is authentic.

The signature is created when the message is sent, using a private encryption key.

This is the opposite to normal PKE.

The signature is then paired with a public key and sent with the message. When the message run through the public key the result should match the signature.

If they don’t match then the message has been altered en route. This shows that the message has been intercepted and compromised.

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

Chapter 15 – Compression, encryption and hashing
Digital certificates

A

While digital signatures verify the trustworthiness of message content, a digital certificate is issued by official Certificate Authorities (CAs) such as Symantec or Verisign and verifies the trustworthiness of a message sender or website. This certificate allows the holder to use the Public Key Infrastructure or PKI. The certificate contains the certificate’s serial number, the expiry date, the name of the holder, a copy of their public

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

Chapter 16 – Database concepts
Modelling data requirements

A

When a systems designer begins work on a new proposed computer system, one of the first things they need to do is to examine the data that needs to be input, processed and stored and determine what the data entities are.

Definition: An entity is a category of object, person, event or thing of interest to an organisation about which data is to be recorded.

Examples of entities are: Employee, Film, Actor, Product, Recipe, Ingredient. Each entity in a database system has attributes.

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

Chapter 16 – Database concepts
A flat file database

A

A flat file database consists of a single file. It might be a suitable structure to hold the names and addresses of all members of a sports club, or information about all the DVDs in your personal collection.
Most databases, however, are concerned with more than one entity, and the relationships between the entities.

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

Chapter 16 – Database concepts
Entity identifier and primary key

A

Each entity needs to have an identifier which uniquely identifies the entity. In a relational database, the entity identifier is known as the primary key and it will be referred to as such in this section. Clearly none of the attributes so far identified for Dentist and Patient is suitable as a primary key. A numeric or string ID such as D13649 could be used. In the entity description, the primary key is underlined.

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

Chapter 16 – Database concepts
Secondary key

A

A database needs to be set up so that it can be searched quickly. An index of all the primary keys in the database, and where the record is held, is automatically maintained by the database software.

However, more than one index may be needed. If for example a patient rings up to make an appointment with the dentist, they are unlikely to know their patient ID, A secondary index on surname is likely to be held.

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

Chapter 16 – Database concepts
Relationships between entities

A

The different entities in a system may be linked in some way, and the two entities are said to be related.
There are only three different ‘degrees’ of relationship between two entities.
A relationship may be
1. One-to-one
Examples of such a relationship include the relationship between Husband and Wife, Country and Prime Minister.

  1. One-to-many
    Examples include the relationship between Mother and Child, Customer and Order, Borrower and Library Book.
  2. Many-to-many
    Examples include the relationship between Student and Course, Stock Item and Supplier, Film and Actor.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

Chapter 16 – Database concepts
Entity relationship modelling

A

The relationship between entities can be modelled graphically. An entity relationship diagram is a diagrammatic way of representing the relationships between the entities in a database. To show the relationship between two entities, both the degree and the name of the relationship need to be specified.

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

Chapter 16 – Database concepts
The concept of a relational database

A

In a relational database, a separate table is created for each entity identified in the system. Where a relationship exists between entities, an extra field called a foreign key links the two tables.

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

Chapter 16 – Database concepts
Foreign key

A

A foreign key is an attribute that creates a join between two tables. It is the attribute that is common to both tables, and the primary key in one table is the foreign key in the table to which it is linked.

Example: In the one-to-many relationship between Dentist and Patient, the entity on the ‘many’ side of the relationship will have DentistID as an extra attribute. .

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

Chapter 16 – Database concepts
Linking tables in a many-to-many relationship

A

When there is a many-to-many relationship between two entities, tables cannot be directly linked in this way.

For example, consider the relationship between Student and Course. A student takes many courses, and the same course is taken by many students.

In this case, an extra table is needed to link the Student and Course tables. We could call this StudentCourse, or Enrolment, for example.

The three tables will now have attributes something like those shown below:
Student (StudentID, Name, Address)
Enrolment (StudentID, CourseID)
Course (CourseID, Subject, Level)

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

Chapter 16 – Database concepts
Composite key

A

In this data model, the table linking Student and Course has two foreign keys, each linking to one of the two main tables. The two foreign keys also act as the primary key of this table. A primary key which consists of more than one attribute is called a composite primary key.

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

Chapter 16 – Database concepts
Drawing an entity relationship diagram

A

A database system will frequently involve many different entities linked to each other, and an entity relationship diagram can be drawn to show all the relationships.

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

Chapter 16 – Database concepts
Referential integrity

A

When tables are linked in a relational database, it is important to ensure that, for example, a particular component is not deleted if it is used in a product in the Product table. This is known as referential integrity.

29
Q

Chapter 17 – Relational databases and normalisation
Indexing

A

In order that a record with a particular primary key can be quickly located in a database, an index of primary keys will be automatically maintained by the database software, giving the position of each record according to its primary key.

29
Q

Chapter 17 – Relational databases and normalisation
Relational database design

A

A relational database is a collection of tables in which relationships are modelled by shared attributes.

30
Q

Chapter 17 – Relational databases and normalisation
Linking database tables

A

Tables may be linked through the use of a common attribute. This attribute must be a primary key of one of the tables, and is known as a foreign key in the second table.

31
Q

Chapter 17 – Relational databases and normalisation
Normalisation

A

Normalisation is a process used to come up with the best possible design for a relational database.
Tables should be organised in such a way that:
- no data is unnecessarily duplicated (i.e. the same data item held in more than one table)
- data is consistent throughout the database (e.g. a customer is not recorded as having different addresses in different tables of the database). Consistency should be an automatic consequence of not holding any duplicated data. This means that anomalies will not arise when data is inserted, amended or deleted.
- the structure of each table is flexible enough to allow you to enter as many or as few items (for example, components making up a product) as required
- the structure should enable a user to make all kinds of complex queries relating data from different tables
There are three basic stages of normalisation known as first, second and third normal form.

32
Q

Chapter 17 – Relational databases and normalisation
First normal form

A

A table is in first normal form (1NF) if it contains no repeating attribute or groups of attributes.
As the first stage in normalization, we need to note that there are repeating groups of attributes in this table; for example, ProductID 123 has three components with IDs ST01, G56 and FF77. We need to split the data into two tables to get rid of the repeating groups.

33
Q

Chapter 17 – Relational databases and normalisation
Second normal form - Partial key dependence test

A

A table is in second normal form (2NF) if it is in first normal form and contains no partial dependencies. A partial dependency would mean that one or more of the attributes depends on only part of the primary key, which can only occur if the primary key is a composite key.

34
Q

Chapter 17 – Relational databases and normalisation
Third normal form - Non-key dependence test

A

A table is in third normal form (3NF) if it is in second normal form and contains no ‘non-key dependencies’. A non-key dependency is one where the value of an attribute is determined by the value of another attribute which is not part of the key.

35
Q

Chapter 17 – Relational databases and normalisation
The importance of normalisation

A

A normalised database has major advantages over an un-normalised one.
- No data redundancy
- Maintaining and modifying the database
- Faster sorting and searching
- Deleting records

36
Q

Chapter 17 – Relational databases and normalisation
No data redundancy

A

One of the aims of normalising a database design is to remove the possibility of redundant data from any of the tables. Redundant data is data that appears in more than one database table.

37
Q

Chapter 17 – Relational databases and normalisation
Maintaining and modifying the database

A

Data integrity is maintained since there is no unnecessary duplication of data. For example, a customer with a particular customer ID will have their personal details stored only once. If the customer changes address, the update needs only to be made to a single table, so there is no possibility of inconsistencies arising with different addresses for the customer being held on different files.

38
Q

Chapter 17 – Relational databases and normalisation
Faster sorting and searching

A

Normalisation will produce smaller tables with fewer fields. This results in faster searching, sorting and indexing operations as there is less data involved.
A further advantage is that holding data only once saves storage space.

39
Q

Chapter 17 – Relational databases and normalisation
Deleting records

A

A normalised database with correctly defined relationships between tables will not allow records in a table on the ‘one’ side of a one-to-many relationship to be deleted accidentally. For example, a customer who still has unresolved transactions on file cannot be deleted. This will prevent accidental deletion of a customer who has an unpaid invoice recorded, for example.

40
Q

Chapter 18 – Introduction to SQL
SQL

A

SQL, or Structured Query Language (pronounced either as S Q-L or Sequel) is a declarative language used for querying and updating tables in a relational database. It can also be used to create tables. In this chapter, we will look at SQL statements used in querying a database.

41
Q

Chapter 18 – Introduction to SQL
SELECT .. FROM .. WHERE

A

The SELECT statement is used to extract a collection of fields from a given table. The basic syntax of this statement is:
SELECT list the fields to be displayed
FROM list the table or tables the data will come from
WHERE list the search criteria
ORDER BY list the fields that the results are to be sorted on (default is Ascending order)

42
Q

Chapter 18 – Introduction to SQL
Conditions

A

= Equal

> Greater

< Less than

!= Not equal to

> = Greater than or equal to

<= Less than or equal to

IN
Equal to a value within a set of values

LIKE
Similar to

BETWEEN… AND
Within a range, including the two values which define the limits

IS NULL
Field does not contain

AND
Both expressions must be true for the entire expression to be judged true

OR
If either or both of the expressions are true, the entire expression is judged true.

NOT
Inverts truth

43
Q

Chapter 18 – Introduction to SQL
Specifying a sort order

A

ORDER BY gives you control over the order in which records appear in the Answer table. If for example you want the records to be displayed in ascending order of CDTitle and within that, descending order of DatePublished, you would write, for example:
SELECT *
FROM CD
WHERE DatePublished < #01/01/2015#
ORDER BY CDTitle, DatePublished Desc

44
Q

Chapter 18 – Introduction to SQL
Extracting data from several tables

A

Using SQL you can combine data from two or more tables, by specifying which table the data is held in. For example, suppose you wanted SongTitle, ArtistName and MusicType for
all Art Pop music. When more than one table is involved, SQL uses the syntax tablename.fieldname. (The table name is
optional unless the field name appears in more than one table.)

45
Q

Chapter 18 – Introduction to SQL
SQL JOIN

A

JOIN provides an alternative method of combining rows from two or more tables, based on a common field between them. The query above could be written as follows:
SELECT Song.SongTitle, Artist.ArtistName, Song.MusicType
FROM Song
JOIN Artist
ON Song.ArtistID = Artist.ArtistID
WHERE Song.MusicType = “Art Pop”

46
Q

Chapter 19 – Defining and updating tables using SQL
Defining a database table

A

Use SQL to create a table named Employee, which has four columns: EmpID (a compulsory int field which is the primary key), Name (a compulsory character field of length 10), HireDate (an optional date field) and Salary (an optional real number field).
CREATE TABLE Employee
(
EmpID INTEGER NOT NULL, PRIMARY KEY,
EmpName VARCHAR(20) NOT NULL,
HireDate DATE,
Salary CURRENCY
)

47
Q

Chapter 19 – Defining and updating tables using SQL
Data types

A

CHAR(n) Character string of fixed length n

VARCHAR(n) Character string variable length, max. n

BOOLEAN TRUE or FALSE

INTEGER, INT

FLOAT Number with a floating decimal point

DATE Stores Day, Month, Year values

TIME Stores Hour, Minute, Second values

CURRENCY Formats numbers in the currency used in your region

48
Q

Chapter 19 – Defining and updating tables using SQL
Altering a table structure

A

The ALTER TABLE statement is used to add, delete or modify columns (i.e. fields) in an existing table.

To add a column (field):
ALTER TABLE Employee
ADD Department VARCHAR(10)

To delete a column:
ALTER TABLE Employee
DROP COLUMN HireDate

To change the data type of a column:
ALTER TABLE Employee
MODIFY COLUMN EmpName VARCHAR(30)NOT NULL

49
Q

Chapter 19 – Defining and updating tables using SQL
Defining linked tables

A

Suppose that an extra table is to be added to the Employee database which lists the training courses offered by the company. A third table shows which date an employee attended a particular course.

The structure of the Employee table is:
EmpID Integer (Primary key)
Name 30 characters maximum
HireDate Date
Salary Currency
Department 30 characters maximum

The structure of the Course table is:
CourseID 6 characters, fixed length (Primary key)
CourseTitle 30 characters maximum (must be entered)
OnSite Boolean

The structure of the CourseAttendance table is:
CourseID 6 characters, fixed length (foreign key)
EmpID Integer (foreign key) Course ID and EmpID form a composite primary key
CourseDate Date (note that the same course may be run several times on different dates)

The CourseAttendance table is created using the SQL statements:
CREATE TABLE CourseAttendance
(
CourseID CHARACTER(6)NOT NULL,
EmpID INTEGER NOT NULL,
CourseDate DATE,
FOREIGN KEY CourseID REFERENCES Course(CourseID),
FOREIGN KEY EmpID REFERENCES Employee(EmpID)
PRIMARY KEY (CourseID, EmpID)
)

50
Q

Chapter 19 – Defining and updating tables using SQL
Inserting, updating, and deleting data using SQL
The SQL INSERT INTO statement

A

This statement is used to insert a new record in a database table. The syntax is:
INSERT INTO tableName (column1, column2, …)
VALUES (value1, value2, …)

51
Q

Chapter 19 – Defining and updating tables using SQL
Inserting, updating, and deleting data using SQL
The SQL UPDATE statement

A

This statement is used to update a record in a database table. The syntax is:
UPDATE tableName
SET column1 = value1, column2 = value2, …
WHERE columnX = value

52
Q

Chapter 19 – Defining and updating tables using SQL

The SQL DELETE statement

A

This statement is used to delete a record from a database table. The syntax is:
DELETE FROM tableName
WHERE columnX = value

52
Q

Chapter 19 – Defining and updating tables using SQL

The SQL DELETE statement

A

This statement is used to delete a record from a database table. The syntax is:
DELETE FROM tableName
WHERE columnX = value

52
Q

Chapter 19 – Defining and updating tables using SQL
Inserting, updating, and deleting data using SQL
The SQL DELETE statement

A

This statement is used to delete a record from a database table. The syntax is:
DELETE FROM tableName
WHERE columnX = value

53
Q

Chapter 20 – Transaction processing
Capturing data

A

Before data is added to a database, it has to be captured or input by some means or other. Manual methods include transcribing data from a form that has been filled in, for example by a customer ordering items from a catalogue or a market researcher filling in forms on the High Street.

Cheques paid in at a bank are scanned using magnetic ink character recognition (MICR); the bank number, customer account number and cheque number are printed in special magnetic ink along the bottom of the cheque. The amount of the cheque has to be manually entered by the bank clerk.

54
Q

Chapter 20 – Transaction processing
Selecting and managing data

A

Data may be selected before it is even added to a database, depending on whether or not it matches specified criteria. For example, a speed camera may automatically photograph only
those vehicles which are exceeding the speed limit.

Once in the database, SQL may be used to select data from different tables which match required criteria. Using the selected data, reports may be produced, letters sent out by post or email, new stock items automatically re-ordered, records added, updated or deleted.

55
Q

Chapter 20 – Transaction processing
Exchanging data

A

A common method of transferring data between one computer system and another (usually via the Internet) without the need for human intervention is EDI (Electronic Data Interchange). Using standardised message formatting, documents can be exchanged electronically. Transaction software processes the information and the software on the receiving end looks up details of, for example, items to be purchased, price, buyer’s name and address etc. in an order processing system.

56
Q

Chapter 20 – Transaction processing
Transaction processing and ACID

A

The database system has to ensure that it is not possible to complete only part of a transaction, for example booking the cinema ticket without paying for it. ACID (Atomicity, Consistency, Isolation, Durability) is a set of properties that guarantees that transactions are processed reliably.

57
Q

Chapter 20 – Transaction processing
Atomicity

A

Atomicity requires that a transaction must be processed in its entirety or not at all. Atomicity must guarantee that in any situation, including power cuts or hard disk crashes, it is not possible to process only part of a transaction.

58
Q

Chapter 20 – Transaction processing
Consistency

A

The consistency property ensures that no transaction can violate any of the defined validation rules for maintaining the integrity of the database. When a database is created, referential integrity rules will be specified between linked tables. Thus it will not be possible, for example, to record a mark in a RESULTS table for a student who is not in the STUDENT table in the database. Similarly, it will not be possible to delete a record from the STUDENT table if they have marks on the RESULTS table.

59
Q

Chapter 20 – Transaction processing
Isolation

A

The isolation property ensures that concurrent execution of transactions leads to the same results as if transactions were processed one after the other.

60
Q

Chapter 20 – Transaction processing
Durability

A

The durability property ensures that once a transaction has been committed, it will remain so, even in the event of a power cut. For example, if the online sale of a cinema ticket is in the process of being completed, it should not be possible for the number of seats sold to be updated but the customer’s debit card not processed. As each part of the transaction is completed, it is held in a buffer on disk until all elements of the transaction are completed. Only then will the changes to the database tables be made.

61
Q

Chapter 20 – Transaction processing
Potential problems with multi-user databases

A

Allowing multiple users to simultaneously update a database table may cause one of the updates to be lost unless measures are taken to prevent this.
When an item is updated, the entire record (indeed the whole block in which the record is physically held) will be copied into the user’s own local memory area at the workstation.

62
Q

Chapter 20 – Transaction processing
Record locks

A

Record locking is the technique of preventing simultaneous access to objects in a database in order to prevent updates being lost or inconsistencies in the data arising. In its simplest form, a record is locked whenever a user retrieves it for editing or updating. Anyone else attempting to retrieve the same record is denied access until the transaction is completed or cancelled.

63
Q

Chapter 20 – Transaction processing
Problems with record locking

A

If two users are attempting to update two records, a situation can arise in which neither can proceed,
known as deadlock. Suppose a bank clerk is updating Customer A’s record with a transfer to Customer
B’s account.

The DBMS must recognise when this situation has occurred and take action. Serialisation, timestamp ordering or commitment ordering may be used.

64
Q

Chapter 20 – Transaction processing
Serialisation

A

This is a technique which ensures that transactions do not overlap in time and therefore cannot interfere with each other or lead to updates being lost. A transaction cannot start until the previous one has finished. It can be implemented using timestamp ordering.

65
Q

Chapter 20 – Transaction processing
Timestamp ordering

A

Whenever a transaction starts, it is given a timestamp, so that if two transactions affect the same object (for example record or table), the transaction with the earlier timestamp should be applied first.

In order to ensure that transactions are not lost, every object in the database has a read timestamp and a write timestamp, which are updated whenever an object in a database is read or written.

66
Q

Chapter 20 – Transaction processing
Commitment ordering

A

This is another serialisation technique used to ensure that transactions are not lost when two or more users are simultaneously trying to access the same database object. Transactions are ordered in terms of their dependencies on each other as well as the time they were initiated. It can be used to prevent deadlock by blocking one request until another is completed.

67
Q

Chapter 20 – Transaction processing
Redundancy

A