Databases Flashcards
characteristics of serial files
- data is stored in the order in which it was entered
- no order to the data is maintained
- useful for storing transactional data and initialisation files
what are files
permanent storage of data
alternative to a series file
sequential file
characteristics of a sequential file
- stores data in order of key field
- this order is maintained when new records are added
- useful for storing master files
- index sequential files allow groups of records to be accessed quickly
advantages of databases
- makes processing more efficient
- reduces storage requirements
- avoids redundancy
- allows different users to only see relevant dat
what is the data management system
- an additional layer of software which provides
- manipulation language to access and change the data
- integrity to ensure efficiency and structure is not compromised
- additional security
- an interface for other programs to access and use the data
- program/ data independence
examples of DMBs
oracle
what is a flat file database
allows the user to specify data attributes for only one table at a time, storing those attributes independently, there is no link between the different files
what are relational databases
allows the user to specify information about multiple tables and the relationship between those tables
what is a primary key
- a field which identifies the table
- has to be unique and has to exist
what is normalisation
the concept of splitting up tables in a database and arranging the data tk move it from first to second to third normal form
how to get a database into first normal form
- eliminate duplicate columns
- get rid of any groups of repeating data
- identify the primary key
- separate any attributes which are not atomic into separate attributes
what is a composite key
a combination of two or more columns in a table that can be used to uniquely identify each row in the table
- uniqueness is only guaranteed when the columns are combined
how to get a database into second normal form
- check that data is already in 1NF
- remove any partial dependencies
- fix any many to many rls
what is a partial dependency
means that one or more of the attributes depends on only part of the primary key
- this can only occur when the primary key is a composite key
what should we do if we find a partial dependency
split the table on that attribute and move it to a separate table
what are the issues with a many to many relationship
Without proper normalization, many-to-many relationships can lead to data redundancy and inconsistencies.
how to solve the many to many relationship issue
create a linking table
how to get database into third normal form
- check data is in second normal form
- check there are no non key dependencies
what is a non key dependency
where the value of an attribute is determined by an attribute which is not part of the key
aim of normalisation
- minimises data duplication
- improves consistency
- eliminate insertion anomalies
- eliminate data redundancy
- eliminate update/deletion anomalies