DATABASES Flashcards

(30 cards)

1
Q

State the benefits of using a relational database instead of a flat file database

A
  • Relational data allows for less redundancy of data / less repeated data
  • Relational databases improve the consistency of data
  • Relational databases allow for complex queries and/or searches to be performed
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

State the difference between a primary key and a foreign key

A
  • A primary key will only appear once in a table / is a unique identifier
  • A foreign key may appear multiple times in a table / may not be unique
  • A foreign key links two tables together
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Describe a method a streaming service could use to capture a new customer’s personal data

A
  • Web form
  • Can use validation to check for common errors
  • Can check for duplicate values
  • Data can be entered direct into the database / limited manual processing
  • Can be done from remote locations
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Identify methods of exchanging data with other computer systems

A
  • CSV
  • JSON
  • XML
  • SQL
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Describe what is meant by a transaction being durable

A
  • Data / transaction is not lost
  • In case of power / system failure
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Give one way that durability can be achieved for a completed transaction

A
  • Completed transactions stored in secondary storage (data not stored long-term in RAM/cache)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Explain how record locking can be used to ensure that the ACID principle of isolation is achieved when carrying out multiple transactions

A
  • The outcome of concurrent transactions is the same as if transactions were completed sequentially
  • Record locking allows one user / process to access / modify record level data at any one time
  • So data that is being used elsewhere cannot be modified / data that is being modified elsewhere cannot be used
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What are the disadvantages of record locking

A
  • Can cause delays (as users wait for access)
  • Can cause deadlock
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Describe what is meant by the term ‘referntial integrity’ and how this could potentially be broken

A
  • Database / relationships are consistent (each foreign key links to an existing / valid primary key)
  • If a record is removed all references to it are removed
  • A foreign key value must have a corresponding Primary key value in another table
  • e.g. If primary key is deleted / updated, foreign keys are no longer valid / changes should be cascaded
  • e.g. Cascade delete can cause necessary records to be deleted due to records from associated tables being deleted
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Describe what is meant by the term ‘Atomic’ in the context of ACID transactions.

A
  • A transaction / review can only be fully complete or not complete (cannot partially complete)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

State what the letters in ACID stand for

A

Atomicity
Consistency
Isolation
Durability

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

Describe the different types of format used to exchange data

A
  • CSV (Comma Separated Value)
  • A text file/format with values separated by commas (or some other delimiter)
  • XML/eXtensible Markup Language
  • A markup language that uses tags to denote data
  • SQL / Structured Query language
  • A language for creating/querying databases
  • JSON / JavaScript Object Notation
  • Test format that can easily be changed to and from JavaScript Options
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Give an advantage and disadvantage of indexing a field in a database

A
  • Advantage: Searches of the field can be performed more quickly
  • Disadvantage: The index takes up extra space in the database
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What is a secondary key (secondary index)

A
  • Allows a database to be searched quickly
  • Makes it possible to order and search attributes, which makes it easier to find specific patterns in the database
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What are the advantages of flat file databases

A
  • Quick to set up
  • Require little expertise to maintain
    (Suitable for storing small amounts of data)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What is Optical Character Recognition and gives examples form where it has been used

A
  • Automatically reads text by interpreting the shape of the letters, which helps to speed up and automate data input
  • The Post Office uses OCR software to read postcodes and route mail
  • Road cameras use automatic number plate recognition software to handle congestion charging and identify drivers who are speeding
17
Q

What is Optical Mark Recognition

A
  • Used for multiple-choice tests or lottery tickets
  • It is a very fast and efficient way of collecting data and inputting it in a database while significantly reducing human error
18
Q

What are the advantages of OCR

A
  • Cheaper than paying someone to manually enter large amounts of text
  • Much faster than someone manually entering large amounts of text
  • The latest software can recreate tables and the original layout
19
Q

What are the advantages of OMR

A
  • A fast method of inputting large amounts of data
  • Only one computer needed to collect and process data
  • OMR is much more accurate than data being keyed in by a person
20
Q

What is meant by transaction processing

A

Any information processing that is divided into individual, indivisible operations called transactions

21
Q

What are the base functionalities of relational databases

A

Create
Read
Update
Delete

22
Q

What is meant by a transaction being in isolation

A
  • A transaction must not be interrupted by another transaction
  • The transaction must occur in isolation so other users or processes cannot access the data concerned
23
Q

What is meant when a transaction is consistent

A

Any change in the database must retain the overall state of the database

24
Q

What are the conditions for a table to be in 1NF

A
  • All field names must be unique
  • Values in fields should be from the same domain
  • Values in fields should be atomic
  • No two records can be identical
  • Each table needs a primary key
25
What is a composite key
- A combination of two or more fields in a table that can be used to uniquely identify each record - Uniqueness is only guaranteed when fields are combined
26
What are the conditions for a table to be in 2NF
- The data is already in 1NF - Any partial dependencies have been removed (Every field is dependent on the entire primary key)
27
What is the trick for spotting when to split a table
If a field or group of fields can be inferred from a field that isn't the primary key, they are candidates for splitting into a seperate table
28
How can a many-to-many relationship be fixed between two tables in 2NF
- Create a linking table - Assign the primary keys from the two initial tables as the composite key for the new linking table - Flip the M:M crows feet relationship to become two 1:M relationships joined by the new table
29
What are the conditions for a table to be in 3NF
- The data is already in 2NF - Any transitive dependencies have been removed (Remove any instances where a non-key field is dependent on another non-key field)
30
What is data integrity
The maintenance and consistency of data in a data store. The data store must reflect the reality that it represents.