Exchanging data Flashcards

(133 cards)

1
Q

Why is compression used?

A

To reduce file size so data uses less storage, transfers faster, and loads more quickly — especially important for mobile devices, limited bandwidth, and internet buffering.

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

What is lossless compression?

A

A method that reduces file size without losing any data, allowing the original file to be perfectly reconstructed.

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

When is lossless compression used?

A

When accuracy is essential — text files, program files, spreadsheets, and some image formats (e.g., PNG)

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

What is lossy compression?

A

A method that removes non‑essential data to reduce file size, resulting in some loss of quality.

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

When is lossy compression used?

A

For media where perfect accuracy isn’t required — images (JPEG), audio (MP3), video (MP4).

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

What are the effects of lossy compression on images?

A

Blurring, blocky artefacts, reduced detail, and distortion — but much smaller file sizes.

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

What is the main advantage of lossy compression?

A

Dramatically smaller file sizes compared to lossless methods

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

What is the main disadvantage of lossy compression?

A

The original file cannot be perfectly restored; quality is permanently reduced.

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

Why is compression especially important for the internet?

A

It speeds up page loading, reduces bandwidth usage, and improves performance on slow connections.

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

Why is lossy compression effective for sound and video?

A

Because the human ear and eye cannot detect small changes, so non‑essential data can be removed without noticeably affecting quality.

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

What is the key idea behind lossless compression?

A

It finds patterns in the data and stores those patterns instead of the raw data, allowing perfect reconstruction.

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

Why does lossless compression produce larger files than lossy?

A

Because it keeps all the original information — nothing is permanently removed.

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

Give an example of when lossless compression is used.

A

Zipped folders, text documents, PNG images, and PDFs that must remain identical to the original.

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

Give an example of when lossy compression is used.

A

Website images (JPEG), MP3 audio, MP4 video.

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

What is Run Length Encoding (RLE)?

A

A lossless compression method that stores the value and how many times it repeats instead of storing each item individually.

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

Why does RLE work well on some images?

A

Because many images (especially simple or pixel‑block images) contain long runs of identical colours.

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

What does RLE store for each run?

A
  • The colour value
  • The number of contiguous pixels of that colour
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

Why is RLE less effective on detailed photographs?

A

Because natural images rarely have long runs of identical pixels, so compression is minimal.

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

What type of compression is RLE?

A

Lossless — the original data can be perfectly reconstructed.

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

What is dictionary‑based compression?

A

A lossless compression method that replaces repeated words or patterns with shorter binary codes stored in a dictionary.

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

How does dictionary‑based compression reduce file size?

A

By storing each repeated word once in a dictionary and referencing it with a short code instead of writing the full word each time.

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

What does the dictionary contain?

A
  • A list of repeated words or patterns
  • A binary code assigned to each entry
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q

Why is dictionary‑based compression effective?

A

Natural language contains many repeated words, so replacing them with short codes saves significant space.

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

Is dictionary‑based compression lossy or lossless?

A

Lossless — the original text can be perfectly reconstructed.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
What is encryption?
The transformation of data into an unreadable form to prevent unauthorised access.
26
What is a cipher?
The method or algorithm used to encrypt and decrypt data.
27
What is a cipher key?
A value used by the cipher to control how the data is encrypted or decrypted.
28
What is the Caesar cipher?
A substitution cipher that shifts each letter of the alphabet by a fixed number of positions.
29
Is the Caesar cipher symmetric or asymmetric?
Symmetric — the same key is used for encryption and decryption.
30
What is XOR used for in encryption?
To combine plaintext and key bits so that the output cannot be reversed without the same key.
31
How do you encrypt a character using XOR?
1. Convert plaintext and key to ASCII binary 2. XOR them bit‑by‑bit 3. Convert the result back to a character
32
What makes a one‑time pad unbreakable?
* Key is truly random * Key is as long as the message * Key is used once only * Key is kept completely secret
33
What happens if a one‑time pad key is reused?
The encryption becomes breakable — this is one of the biggest historical cryptography failures.
34
What is symmetric encryption?
Encryption where the same key is used to encrypt and decrypt the message.
35
What is the main weakness of symmetric encryption?
The key must be shared — if intercepted, the entire system is compromised.
36
What is the main advantage of symmetric encryption?
It is fast and efficient for encrypting large amounts of data.
37
What is asymmetric encryption?
Encryption that uses two keys: a public key for encryption and a private key for decryption.
38
What is the public key used for?
Anyone can use it to encrypt a message for the key owner.
39
What is the private key used for?
Only the owner uses it to decrypt messages encrypted with their public key.
40
Why is asymmetric encryption secure?
Because the private key is never shared, and the maths behind the key pair makes it computationally infeasible to derive the private key from the public key.
41
What is cryptanalysis?
The study and practice of breaking encryption systems or finding weaknesses in them.
42
What is “perfect security”?
When a cipher cannot be broken even with unlimited computing power (e.g., a one‑time pad)
43
What is the purpose of a digital signature?
To verify the sender’s identity and ensure the message has not been altered.
44
How does a digital signature work?
* Sender encrypts a hash of the message using their private key * Receiver decrypts it using the public key * If the hash matches, the message is authentic
45
Why might governments want access to encryption keys?
* To investigate terrorism or serious crime * To protect national security * To access evidence that criminals hide behind encryption
46
Why might people oppose government access to encryption keys?
* It weakens privacy and civil liberties * Creates a security vulnerability if keys are leaked or misused * Undermines trust in digital communication * Could be exploited by authoritarian regimes
47
What is a hashing function?
A one‑way function that maps input of any length to a fixed‑length output (a hash).
48
Why is hashing one‑way?
Because you cannot reverse a hash to recover the original input — it’s mathematically infeasible.
49
Why is hashing used for passwords?
The system stores only the hash, not the password. When you log in, your input is hashed and compared — so even if the database is stolen, the passwords aren’t exposed.
50
What is a cryptographic hash function?
A hash designed so that even a tiny change in input produces a completely different output (the avalanche effect).
51
What is a hash total / checksum / digest used for?
To verify that data hasn’t been changed or corrupted during transmission.
52
What is a digital signature?
An encrypted hash value that proves a message came from a specific sender and hasn’t been altered.
53
How is a digital signature created?
1. Sender hashes the message 2. Sender encrypts the hash using their private key 3. Encrypted hash is sent with the message
54
How is a digital signature verified?
1. Receiver decrypts the signature using the sender’s public key 2. Receiver hashes the message themselves 3. If both hashes match, the message is authentic and unchanged
55
Why does a digital signature prove identity?
Only the sender has their private key — so only they could have created that encrypted hash.
56
How does a digital signature protect against viruses?
* If a file is digitally signed, you can verify it genuinely came from a trusted sender * A virus pretending to be from a trusted source would fail verification * This prevents users from opening malicious files disguised as legitimate ones
57
What is a digital certificate?
A trusted, third‑party‑issued document that confirms a public key genuinely belongs to the claimed sender.
58
Why are digital certificates important?
They prevent attackers from creating fake keys and pretending to be someone else.
59
How do digital certificates support digital signatures?
They verify that the public key used to check the signature is authentic and belongs to the real sender.
60
Why is compression necessary for images on the web?
To reduce file size so pages load faster, use less bandwidth, and perform better on mobile devices.
61
Why is lossy compression unsuitable for large text documents?
Text cannot tolerate data loss — even a small change alters meaning, so lossy methods would corrupt the content.
62
What is an entity?
A real‑world object, person, event, or thing about which data is stored in a database.
63
What is an attribute?
A property or characteristic of an entity
64
What is a flat‑file database?
A database stored in a single table or file, suitable for simple datasets with one entity.
65
Why are flat‑file databases limited?
They cannot efficiently represent relationships between multiple entities and lead to data duplication.
66
What is an entity identifier?
A field that uniquely identifies each record in an entity — also called the primary key.
67
What is a secondary key?
A field used for searching and indexing, not for uniquely identifying records.
68
What are the three types of relationships in databases?
* One‑to‑one * One‑to‑many * Many‑to‑many
69
Why are entity relationship diagrams useful?
They help designers understand how data connects, avoid duplication, and plan relational tables.
70
What is a relational database?
A database where each entity is stored in its own table, and relationships between entities are created using foreign keys.
71
What is a foreign key?
An attribute in one table that links to the primary key of another table.
72
Where does the foreign key appear in a one‑to‑many relationship?
On the many side of the relationship.
73
Why are foreign keys important?
They enforce referential integrity and allow tables to be joined.
74
Why can’t two tables be directly linked in a many‑to‑many relationship?
Because each record in both tables can relate to multiple records in the other — this causes duplication and inconsistency.
75
How is a many‑to‑many relationship implemented?
By creating a linking table
76
What is a composite key?
A primary key made up of more than one attribute.
77
Where is a composite key commonly used?
In linking tables for many‑to‑many relationships
78
Why do linking tables use composite keys?
Because the combination of the two foreign keys uniquely identifies each relationship instance.
79
What is referential integrity?
A rule ensuring that relationships between tables remain valid — you cannot delete or change a record if it would leave related records “orphaned”.
80
What does “Cascade Update” mean?
If a primary key changes, all related foreign keys update automatically.
81
What does “Cascade Delete” mean?
If a record is deleted, all related records in linked tables are also deleted.
82
What is an entity name?
The name of the table representing a real‑world object
83
What is a primary key?
A unique identifier for each record in a table
84
What is indexing in a database?
A method of speeding up searches by creating a sorted structure (index) on a chosen field.
85
What is the purpose of normalisation?
To reduce redundancy, avoid anomalies, and ensure data is stored efficiently.
86
What problems occur when a table is not normalised?
* Repeated data * Inconsistent updates * Wasted storage * Difficulty searching * Risk of anomalies (update, insert, delete)
87
What is First Normal Form (1NF)?
A table is in 1NF when: * There are no repeating groups * Every field contains atomic (indivisible) values * Each record is unique
88
What is a repeating group?
Multiple values stored in the same row for the same attribute (e.g., several components listed under one product).
89
Why are repeating groups a problem?
* They violate First Normal Form (1NF) * They cause wasted space * They limit how many components can be stored * They make queries and updates messy and error‑prone
90
When is a table in 2NF?
When it is in 1NF Contains no partial dependencies.
91
What is a partial dependency?
When a non‑key attribute depends on part of a composite primary key, not the whole key
92
When can partial dependencies occur?
Only when the primary key is composite.
93
What does “normalising to third normal form” mean?
Structuring tables so that: * All fields depend on the key (1NF) * All non‑key fields depend on the whole key (2NF) * No non‑key field depends on another non‑key field (3NF)
94
What is a non‑key dependency?
When a non‑key attribute depends on another non‑key attribute instead of the primary key.
95
How do you fix a non‑key dependency?
Move the dependent attribute into a new table.
96
What is data redundancy?
When the same data appears in multiple places — leading to inconsistency and wasted space.
97
What is data integrity?
Ensuring data is accurate and consistent — e.g., a customer’s address is stored only once.
98
Why is a normalised database easier to maintain?
Updates only need to happen in one place, reducing errors and effort
99
Why does normalisation make searching and sorting faster?
Because tables contain fewer fields and less duplicated data, so the database engine processes smaller, cleaner datasets.
100
Why does normalisation save storage space?
Each piece of data is stored once, not repeated across multiple records.
101
How does normalisation prevent accidental deletion?
Properly defined relationships (with referential integrity) stop you deleting a record that still has dependent records
102
What does “capturing data” mean in database systems?
The process of collecting data and entering it into a computer system so it can be stored, processed, or queried.
103
What are manual methods of capturing data?
Typing information from forms, entering customer details online, filling in digital forms.
104
What is MICR used for?
Reading the magnetic ink on cheques so banks can automatically capture cheque numbers
105
What is OMR used for?
Reading shaded areas on forms such as multiple‑choice exams or surveys.
106
What is OCR used for?
Converting printed or handwritten text into digital text (e.g., scanning forms or letters)
107
Give examples of automated data‑capture methods.
* Smart card readers * Passport scanners at airports * Barcode scanners * RFID readers * Biometric scanners (fingerprint, facial recognition) * Contactless payment terminals * Vehicle number‑plate recognition systems
108
What does ACID stand for?
Atomicity, Consistency, Isolation, Durability.
109
Why is record locking necessary?
To prevent two users from editing the same record at the same time, avoiding conflicts and corruption.
110
Why might data be selected before uploading to a database?
To ensure only relevant or current data is processed
111
How is data exchanged between systems?
Using standard file formats like CSV, transferred via the internet and imported into the receiving system.
112
What is Atomicity?
A transaction must be processed entirely or not at all — no partial updates allowed.
113
What is Consistency?
A transaction must preserve database rules — e.g., referential integrity must not be violated
114
What is Isolation?
Transactions must behave as if they were processed one at a time, even if run concurrently
115
What is Durability?
Once a transaction is committed, it remains so — even after a power cut or crash.
116
117
What is the main risk when multiple users update a database at the same time?
One user’s update can overwrite another’s — leading to lost updates and inconsistent data.
118
What is a record lock?
A mechanism that prevents more than one user from accessing the same record for editing at the same time.
119
What happens when a record is locked?
Other users are denied access until the lock is released.
120
Why is record locking important?
It prevents simultaneous edits that could corrupt data or cause updates to be lost.
121
What is the downside of record locking?
It can lead to deadlock if two users lock different records and then try to access each other’s locked record.
122
What is deadlock?
A situation where two users each hold a lock the other needs, so neither can proceed
123
How does a DBMS resolve deadlock?
Using techniques such as: * Serialisation * Timestamp ordering * Commitment ordering
124
What is serialisation?
Ensuring transactions are processed one after another, not overlapping, so they cannot interfere with each other.
125
How can serialisation be implemented?
Using timestamp ordering, where each transaction is given a time‑based priority.
126
What is timestamp ordering?
A concurrency‑control method where each transaction is given a timestamp, and the system ensures that transactions affecting the same data item are applied in timestamp order.
127
What timestamps does each database object store?
A Read timestamp and a Write timestamp.
128
When is a write transaction rejected?
If the object’s read timestamp is newer than the transaction’s write timestamp — meaning another transaction has read updated data since this one began.
129
Why is timestamp ordering useful?
It prevents outdated transactions from overwriting newer data, avoiding lost updates.
130
What is commitment ordering?
A technique where transactions are committed in an order that respects their logical dependencies, ensuring database integrity.
131
Why is commitment ordering needed?
To prevent conflicts when multiple users try to access or update the same data simultaneously.
132
What is redundancy in transaction‑processing systems?
Having duplicate systems or databases in different locations so operations can continue if one system fails.
133
Why is redundancy important?
It ensures continuity for critical organisations (banks, hospitals, airports) during power failures or disasters.