Databases Flashcards
(23 cards)
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
Problems that can occur with databases that are not fully normalised
Redundant/duplicated data may waste storage space;
If data is stored more than once then it could be inconsistent
If data is stored more than once then each copy of the data would need to be
updated if it changed;
It might not be possible to store data about one type of entity without creating a
record for another type of entity
When a record for one type of entity is deleted it might delete the data about
another type of entity
May be difficult to select/edit data if it is not atomic // if there are repeating groups;
why are non relational better than relational databases
Dynamic Schema:
NoSQL databases don’t require a fixed schema, allowing for easier adaptation to changing data structures and requirements.
Unstructured Data Handling:
They can manage various data formats, including unstructured and semi-structured data like JSON or XML documents.
Rapid Development:
The flexible schema allows for faster development cycles, especially when the data model is not fully defined upfront.
- Scalability and Performance:
Horizontal Scalability:
NoSQL databases can scale horizontally by adding more servers, making them suitable for handling large datasets and high traffic.
High Availability:
Data replication across multiple nodes ensures high availability and fault tolerance, minimizing downtime.
Optimized for Specific Data Types:
Different NoSQL databases are optimized for various data models (e.g., key-value, document, graph), allowing for efficient storage and retrieval of specific data types.