Programming - databases Flashcards
(33 cards)
What is the data life cycle?
stages that data goes through during its existence from initial creation to eventual disposal or archiving
What are the stages of the data life cycle?
collection, disposal, storage, analysis, processing
What are the challenges with data protection?
data quality, accuracy, completeness, and ethical/regulatory considerations – collect only what’s needed
What are challenges with data storage?
Compliance considerations for sensitive data (e.g. Data Protection Act 2018, General Data Protection Regulation (GDPR))
What are problems with data disposal?
ensuring data is permanently removed to prevent unauthorised access, ensuring we do not remove needed data
What is the DBMS?
Database Management Systems
The software that manages databases
What facilities does the DBMS provide?
Allow users to define the database
Allow users to insert, update, delete, and retrieve data from the database
Prevent unauthorised access
Maintain consistency of stored data
Backup data and to restore the database
What is ACID?
Atomicity, Consistency, Isolation, Durability
What does atomicity mean?
All or nothing. A transaction must be performed or not performed at all
What does consistency mean?
A transaction must transform the database from one consistent state to another consistent state
What does isolation mean?
transactions execute independently of one another
What does durability mean?
the effects of a successful transaction are permanently recorded in the database
What are some advantages of DBMS?
Control of data redundancy
Data consistency
Sharing of data becomes easier across entire organisation as data kept in one place
Improved data integrity through constraints (rules) to ensure validity and consistency of data
Improved security with simplified, centralised security measures
Enforcement of consistent standards
Improved data accessibility and responsiveness
Increased productivity
Improved maintenance through data independence
Increased concurrency
Improved backup and recovery services
What are the disadvantages of DBMS?
increased cost - hardware and software, staff training
significantly more complex
have to maintain the system to ensure it stays current
What are the components in the DBMS environment?
Hardware, software, data, procedures and people
What is a relational database?
Store data in structured tables with rows and columns
Relationships between tables defined using primary and foreign key
Suitable for structured date such as financial systems, HR systems
Examples: SQLite, Microsoft SQL Server, MySQL, Oracle Database
What is a NoSQL database?
To handle unstructured or semi structured data
Do not follow a fixed schema
Many types depending on how data is organised (e.g. key-value pairs, JSON, columns)
Suitable for social networks, IOT, real-time analytics
Examples: MongoDB, Oracle NoSQL Database, Apache Cassandra
What is a data model?
A data model is a collection of concepts that can be used to:
- Describe a set of data (structural part)
- The operations to manipulate data
- A set of integrity constraints for the data
What is a primary key?
a unique identifier for each record in a table
What is a foreign key?
a field in one table that links to the primary key in another table
What is a superkey?
An attribute or set of attributes that uniquely identifies a tuple within a relation
A superkey may contain attributes that are not necessary for unique identification
What is a candidate key?
a superkey such that no proper subset is a superkey
What does the entity integrity rules state?
every relation must have a primary key
The primary must not contain null values
What does the referential integrity rule state?
if a foreign key exists in a relation:
- Either the foreign key value must match a candidate key value of some tuple in its home relation
- Or the foreign key value must be wholly null