0% found this document useful (0 votes)
6 views17 pages

IBDP CompSci DatabasesQuick Notes

The document provides an overview of databases, their management systems, and essential concepts such as data integrity, transactions, and concurrency. It explains the differences between databases and spreadsheets, the importance of database management systems, and the need for structured data organization. Additionally, it covers key database terminology and processes like data validation and verification.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views17 pages

IBDP CompSci DatabasesQuick Notes

The document provides an overview of databases, their management systems, and essential concepts such as data integrity, transactions, and concurrency. It explains the differences between databases and spreadsheets, the importance of database management systems, and the need for structured data organization. Additionally, it covers key database terminology and processes like data validation and verification.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 17

COMPUTER SCIENCE

OPTION A

DATABASES
Basic concepts
___

Ms.Shruti Dixit
2

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 a system that allows us to store data in a structured way using


tables and fields, and gives us various means of access to the data.

What is the difference between data and information?

Data is a collection of facts that are meaningless on their own whereas


information puts data into clear understandable context.
3

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 formulas 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 often contain much more data than a spreadsheet.

What is the difference between a database and an information system?


4

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 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 that 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 built- in data validation methods.
5

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 organization: Databases provide a way to organize 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 unauthorized access, ensuring that only authorized users can
access the data.
● Scalability: Databases are designed to handle large amounts of data,
making them a scalable solution for organizations that need to store
and manage large volumes of data.
● Performance: Databases are optimized for performance, allowing users
to access and manipulate data quickly and efficiently. This is especially
6

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
7

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
8

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.
9

AT A GLANCE -

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
10

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
11

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
12

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
13

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.
14

SECTION 2.9 | DATABASE TERMINOLOGY

● Table: A table is a collection of related data organized in rows and


columns. Tables are used to store data in a database and are often
named based on the type of data they contain.
● Record: A record is a collection of data that represents a single entity in
a table. A record is also known as a row, and it typically contains
information about a specific item or object, such as a customer, order,
or product.
● Field: A field is a single piece of data stored in a record. A field is also
known as a column, and it represents a specific attribute or
characteristic of the entity represented by the record.
● Primary Key: A primary key is a field or combination of fields in a table
that uniquely identifies each record in the table. A primary key is used
to enforce data integrity and ensure that no two records in the table are
identical.
15

● Secondary Key: A secondary key is a field or combination of fields in a


table that is not the primary key but can be used to access and query
data in the table.

● Foreign Key: A foreign key is a field in a table that refers to the primary
key of another table. A foreign key is used to create a relationship
between two tables and ensure data integrity across the tables.
16

● Candidate Key: A candidate key is a field or combination of fields in a


table that could be used as the primary key but is not currently used for
that purpose. A candidate key is used to ensure that no two records in
the table are identical.

● Composite Primary Key: A composite primary key is a primary key


that consists of two or more fields in a table. A composite primary key is
used when a single field is not sufficient to uniquely identify each
record
17

in the table.

● Join: A join is a database operation that combines data from two or


more tables based on a related field. A join is used to combine data from
multiple tables into a single result set that can be used for data analysis
or reporting.

*******************

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy