What is a database?
A structured store of data. Usually consists of tables, fields, and records.
What is a flat-file database, and what issues do they face?
A database where all data is stored in one table
What is a relational database, and what are the benefits of using them?
Multiple related tables
Define and give an example of a primary key
A field that has a unique value to act as a unique identifier for every record in that table.
Example: UserID in a table of users
Define and give an example of a foreign key
Example: CustomerID in an orders table to link to the users table
Define and give an example of a secondary key
Example: Surname or date of birth in a user table.
Define indexing and its associated pros and cons.
The index gives the position of each record according to its primary key.
Advantage: Searches of indexed fields can be performed more quickly.
Disadvantage: The index must be rebuilt on edit and takes up extra space in the database.
What three types of database relationships exist, and which one is prohibited?
M:M - These need to be resolved using a middle table with many coming out of each side.
What would a resolved M:M relationship diagram look like?
M:M - These need to be resolved using a middle table with many coming out of each side.
Give some examples of how data can be captured
Give some examples of sensors and what they may be used for.
Altimeter: Measures height from sea level
Accelerometer: Measure forces – When it moves.
Gyroscope: Used to measure rotation.
Thermistor: To read the temperature
GPS: To determine geographical location
Magnetometer: To determine direction.
Heart rate sensor: Detects electrical activity in the heart
Give some examples of the methods used to exchange data
What is referential integrity?
Why is transaction processing required?
Without careful transaction processing, one transaction could accidentally overwrite another or half complete leading to inaccurate data.
What is record locking, why is it required and what issue can be faced?
What are the four rules of transaction processing?
Atomicity
Consistency
Isolation
Durability
Define atomicity from the ACID model for transaction processing
Transactions should be fully complete, or not at all
Define consistency from the ACID model for transaction processing
The transaction should only change the database according to the rules of the database (validation).
Define isolation from the ACID model for transaction processing
Each transaction shouldn’t affect/overwrite other transactions concurrently being processed.
Define durability from the ACID model for transaction processing
Committed data should be saved in secondary storage, so it is not lost in the case of system failure.
What are some examples of good and bad redundancy in a database system? How can bad redundancy be prevented?
Duplication of data
What are the rules for data to be in 1st Normal Form (1NF)?
What are the rules for data to be in 2nd Normal Form (2NF)?
It is in 1NF and every field is dependent on the primary key (All non-key fields depend on key field).
What are the rules for data to be in 3rd Normal Form (3NF)?
All non-key fields don’t depend on another non-key field