COMPUTER SCIENCE CAFÉ
  • WORKBOOKS
  • BLOCKY GAMES
  • GCSE
    • CAMBRIDGE GCSE
  • IB
  • A LEVEL
  • LEARN TO CODE
  • ROBOTICS ENGINEERING
  • MORE
    • CLASS PROJECTS
    • Classroom Discussions
    • Useful Links
    • SUBSCRIBE
    • ABOUT US
    • CONTACT US
    • PRIVACY POLICY
  • WORKBOOKS
  • BLOCKY GAMES
  • GCSE
    • CAMBRIDGE GCSE
  • IB
  • A LEVEL
  • LEARN TO CODE
  • ROBOTICS ENGINEERING
  • MORE
    • CLASS PROJECTS
    • Classroom Discussions
    • Useful Links
    • SUBSCRIBE
    • ABOUT US
    • CONTACT US
    • PRIVACY POLICY

DATABASES | BASIC CONCEPTS

ON THIS PAGE
SECTION 1 | DATABASE SYSTEMS
SECTION 2 | DATABASE MANAGEMENT SYSTEMS
​SECTION 3 | THE NEED FOR DATABASES
SECTION 4 | TRANSACTIONS, STATES AND UPDATES
SECTION 5 | WHAT IS A DATABASE TRANSACTION
SECTION 6 | WHAT IS CONCURRENCY

SECTION 7 | QUERIES AND UPDATES​
SECTION 8 | DATA VALIDATION AND DATA VERIFICATION

ALSO IN THIS TOPIC
YOU ARE HERE | BASIC CONCEPTS
RELATIONAL DATABASES 2.1 - 2.8
RELATIONAL DATABASES 2.9 - 2.20
DATABASE MANAGEMENT
DATABASE MODELS AND ANALYSIS
DATABASE KEY TERMINOLOGY
​
DATABASE ANSWERS

Picture
Topics from the International Baccalaureate (IB) 2014 Computer Science Guide. 
SECTION 1 | DATA SYSTEMS
As its name suggests a database is a base for storing data. With many advantages over the old paper system of storing data, Databases save space(physical storage space, compared to paper records), allow multiple people to access the same data at the same time and queries (similar to filters) can be done to only show the data required.

A database is system that allows us to store data in a structured way using tables and fields, and gives us various means of access to to the data.

What is the difference between a data and information?
Data is a collection of facts that  are meaningless on their own whereas information puts data into clear understandable context. 

What is the difference between a database and a spreadsheet?
Yes, when you look at a database it might look very similar to a spreadsheet. Whilst spreadsheets may primarily be used to manipulate data using functions and formula to perform calculations and statistics, whereas databases are primarily used to store data and often have relationships between tables and should allow the user to easily generate queries to view specific data. Databases are often contain much more data than a spreadsheet.

What is the difference between a database and an information system?
A database may form part of the backend of an information system. As described on wikipedia
     ' An Information system (IS) is a formal, sociotechnical, organizational system designed to collect, process, store, and   distribute information. In a sociotechnical perspective, information systems are composed by four components: task, people, structure (or roles), and technology' (https://en.wikipedia.org/wiki/Information_system)
A database will contain data that is used by information systems where-as the information system comprises of the complete system, furthermore may present the data from the database in a way in which it becomes information. 
​
SECTION 2 | DATABASES MANAGEMENT SYSTEMS (DBMS)
Database Management Systems refer to software used to manage the database, for a single database this could include various software and applications the form a database management system or for a very basic database it could simply be one piece of software such as SQLite. The DBMS should provide an interface for data manipulation, it should provide some form of data security and should have some build in data validation methods.
SECTION 3 | THE NEED FOR DATABASES
Databases are essential for managing large amounts of data efficiently and effectively. Here are some reasons why databases are needed:
​​
  • Data organisation: Databases provide a way to organise data in a structured manner, making it easier to store, retrieve, and manipulate data. Without a database, data would be stored in individual files, which would make it difficult to manage and access.
  • Data integrity: Databases ensure data integrity by providing mechanisms to ensure that data is accurate and consistent. This is important when multiple users or applications need to access the same data. Without a database, it would be difficult to maintain data consistency and accuracy.
  • Data security: Databases provide a secure way to store data by allowing administrators to control access to data. This helps protect sensitive data from unauthorised access, ensuring that only authorised users can access the data.
  • Scalability: Databases are designed to handle large amounts of data, making them a scalable solution for organisations that need to store and manage large volumes of data.
  • Performance: Databases are optimised for performance, allowing users to access and manipulate data quickly and efficiently. This is especially important for applications that need to process large amounts of data quickly.
  • Data sharing: Databases enable data sharing among different applications and users, making it easier for teams to collaborate and share data across different systems and applications.

Databases are essential for managing data effectively, ensuring data integrity, security, and scalability, and optimizing performance.
SECTION 4 | TRANSACTIONS, STATES AND UPDATES
​Transactions, states, and updates are important concepts in database management that are used to maintain data consistency and integrity.
  • Transactions: A transaction is a logical unit of work that consists of one or more database operations that must be executed together as a single, atomic unit. Transactions ensure that either all of the operations are completed successfully or none of them are completed at all. This helps maintain data consistency by ensuring that the database remains in a consistent state, even in the event of errors or system failures.
  • States: States refer to the condition of the database at any given time. Database management systems use states to keep track of changes to the database, including additions, updates, and deletions. The current state of the database is often referred to as the database's current state, and it is important to maintain consistency across different states to ensure data integrity.
  • Updates: Updates refer to changes made to the database, including additions, updates, and deletions. Database management systems use update operations to make changes to the database while maintaining data consistency and integrity. This is accomplished through the use of locking mechanisms, which ensure that only one user can make changes to a particular record at a time. This helps prevent conflicts and inconsistencies in the data.

By using transactions, states, and updates, database management systems can ensure data consistency and integrity by ensuring that changes to the database are made in a controlled and consistent manner. This helps prevent errors, conflicts, and inconsistencies in the data, which can lead to problems with data quality and reliability.
SECTION 5 | WHAT IS A DATABASE TRANSACTION
A database transaction is a logical unit of work that involves one or more database operations, such as insert, update, or delete. A transaction ensures that all of the operations in the unit are executed together as a single, atomic operation, which means that either all of the operations are completed successfully, or none of them are completed at all.

In other words, a transaction is a sequence of database operations that are executed as a single unit of work. Transactions are used to ensure data consistency and integrity by ensuring that the database remains in a consistent state, even in the event of errors, system failures, or other problems.

A typical transaction has four properties, commonly referred to as ACID properties:
​​
  1. Atomicity: A transaction is atomic, which means that either all of its operations are executed successfully or none of them are executed at all. This ensures that the database remains in a consistent state.
  2. Consistency: A transaction ensures that the database remains in a consistent state before and after it is executed.
  3. Isolation: Transactions are executed in isolation from one another, which means that the changes made by one transaction are not visible to other transactions until they are completed.
  4. Durability: Once a transaction is completed, its changes are permanently stored in the database, even in the event of a system failure or other problem.

Database transactions are an essential concept in database management and are used to ensure data consistency, integrity, and reliability.
SECTION 6 | WHAT IS CONCURRENCY
Concurrency in a data sharing situation refers to the ability of multiple users or applications to access and manipulate the same data simultaneously. In a shared data environment, concurrency can lead to conflicts, inconsistencies, and other issues if not managed properly.

In database management, concurrency control is the process of managing concurrent access to data in order to maintain data consistency and integrity. This involves implementing mechanisms to prevent conflicts and inconsistencies that can arise when multiple users or applications attempt to access and manipulate the same data simultaneously.

There are several techniques for managing concurrency in a data sharing situation, including:
  • Locking: Locking involves the use of locks to control access to data. When a user or application accesses a particular record, a lock is placed on that record, preventing other users or applications from accessing or modifying it until the lock is released.
  • Time-stamping: Time-stamping involves assigning a unique timestamp to each transaction that accesses the database. If two transactions attempt to modify the same data, the system can use the timestamps to determine which transaction should be given priority.
  • Multi-version Concurrency Control (MVCC): MVCC involves creating multiple versions of a data record to allow multiple users or applications to access and modify the same data simultaneously. Each user or application sees a version of the data that reflects the state of the database at the time the user or application began the transaction.

Concurrency is an important concept in data sharing situations, and it is essential to manage concurrency effectively to maintain data consistency, integrity, and reliability. Concurrency control mechanisms, such as locking, time-stamping, and MVCC, help to ensure that multiple users or applications can access and manipulate the same data simultaneously without conflicts or inconsistencies.
SECTION 7 | QUERIES AND UPDATES
Databases require two fundamental functions to be performed on them: query functions and update functions.
​
  1. Query Functions: Query functions are used to retrieve data from the database. These functions allow users or applications to search for specific data or to retrieve a subset of data that meets certain criteria. Common query functions include SELECT statements in SQL and find() functions in NoSQL databases. Query functions allow users to perform various types of data analysis and reporting, such as sorting, grouping, filtering, and aggregating data. They are essential for retrieving data from the database and for generating reports and insights.​
  2. Update Functions: Update functions are used to modify the data in the database. These functions allow users or applications to add, update, or delete data in the database. Common update functions include INSERT, UPDATE, and DELETE statements in SQL and save() and remove() functions in NoSQL databases Update functions are essential for maintaining the accuracy and integrity of the data in the database. They allow users to make changes to the data, such as correcting errors, updating records, or deleting obsolete data. Update functions must be used carefully to ensure that data consistency and integrity are maintained.

Databases require both query functions and update functions to be performed on them. Query functions are used to retrieve data from the database and allow for data analysis and reporting. Update functions are used to modify data in the database and ensure data accuracy and integrity. These two functions are essential for managing data effectively in a database system.
SECTION 8 | DATA VALIDATION AND DATA VERIFICATION
Data validation and data verification are two important processes used to ensure the accuracy, completeness, and consistency of data in a database system. Although the terms are sometimes used interchangeably, they refer to different processes.

Data Validation: Data validation is the process of checking whether the data entered into a system is accurate, complete, and consistent with predefined rules and constraints. The purpose of data validation is to ensure that the data entered into the system is correct and can be used reliably.

Data validation is typically performed when data is first entered into the system, and it involves checking for errors, such as missing or invalid data, incorrect data types, or data that does not conform to predefined rules and constraints. Data validation may be performed using automated validation tools, such as regular expressions, or it may involve manual review and correction of data.

Data Verification: Data verification is the process of checking whether the data in the database is accurate, complete, and consistent with the original source. The purpose of data verification is to ensure that the data stored in the database is a true representation of the original data source.

​Data verification is typically performed on a periodic basis, such as during data migrations or when integrating data from multiple sources. It involves comparing the data in the database with the original source to ensure that it is accurate and complete. Data verification may involve manual checks, automated tools, or a combination of both.

Data validation and data verification are both essential processes for ensuring the accuracy, completeness, and consistency of data in a database system. Data validation checks the accuracy and completeness of data when it is first entered into the system, while data verification checks the accuracy and completeness of data stored in the database relative to the original source. By performing both data validation and data verification, organizations can ensure that their data is reliable, accurate, and useful.
Picture
ALSO IN THIS TOPIC
BASIC CONCEPTS
RELATIONAL DATABASES 2.1 - 2.8
RELATIONAL DATABASES 2.9 - 2.20
DATABASE MANAGEMENT
DATABASE MODELS AND ANALYSIS
DATABASE KEY TERMINOLOGYDATABASE ANSWERS
Picture
SUGGESTIONS
We would love to hear from you
SUBSCRIBE 
To enjoy more benefits
We hope you find this site useful. If you notice any errors or would like to contribute material then please contact us.