Databases Flashcards
What is a flat file?
A database that consists of a single file/table.
Based around a single entity and it’s attributes.
What is a disadvantage of a flat file?
Lead to duplication/redundancy if second user entries need to be recorded.
Can lead to inconsistency - database becomes inconsistent in it’s use before repeated value occurred.
What is a record?
Row - Collection of fields about the same entity in a database
What is a field?
Individual attributes about same entity in a database
What is an entity?
A category of a person/real world object/event where data needs to be recorded
What is a primary key?
Unique identifier of a record in a table eg. customerID
What is secondary key
Allows a database to be searched quickly as it can be used as a search term/query
What are the entity relationship models
One to many
Many to Many
One to one
What is database normalisation aimed to do
Reduce inconsistencies
Reduce redundancies
Three types of normalisation and characteristics
First normal form (USA)
-Has a primary key
-Atomic values (non divisible, just one value)
-Single value
Second normal form
-should be in 1nf
-no partial dependencies
3NF
-should be in 1nf,2nf
-no transitive/non key dependencies - attribute should only depend on primary key not each other
What are the seven commands SQL can do
ORDER BY
UPDATE
DELETE
CREATE
JOIN
INSERT INTO
ALTER
What is referential integrity?
Process of ensuring consistency
Ensures data is not removed if required elsewhere in a linked database
What is ACID?
Atomic - A transaction should be processed fully otherwise it wont be recorded
Consistency - any changes should not break the database, must be consistent with how it was before the change.
Isolation - transactions should be isolated and not interfere with another transaction
Durability - a transaction must remain in the database
What is data integrity?
Accuracy and reliability of data in a computer system
What is record locking?
Process of preventing simultaneous access to records so theyre not accessed at the same time