DBMS Overview and Chapter 1
DBMS Overview and Chapter 1
An information System is a set of interrelated components that collect, manipulate, store data and
disseminate information and provide a feedback mechanism to monitor performance.
Data Vs Information
Data- raw facts. The term data is simply defined as “ facts and figures”. Each piece of data is a little
fact that doesn’t mean much on its own. The word data can be used for a singularfact or a
collection of facts. It comes from the Latin word datum, meaning “something given”.
Information- The result of processing raw data to reveal its meaning.
Infromations is defined simply as “ new or knowledge received or given”. It is what results when you
have processed, interpreted, and organized facts. The word comes from the Latin word informatio,
meaning “ formation or conception”.
File based System- Is a type of softeare that allows users to access and organize small groups of data .
File Systmes helps to store a collection of raw files of data into a hard disk.
Example: Borrowing books form the library
Data inquiring:
Book name
Member/ Borrower name
Transaction or Transaction Number
What is a Database?
A database is an organized collection of data that is stored and accessed electronically. Databases are
designed to manage, retrieve, and store large amouts of infromation efficiency, making it easier to
access, update, and analyze data.
Non Relational Database- it can store data but doesn’t have a table and relation. Also called NoSQL.
Ex: MongoDB, Apache Cassandra, Redis, Couchbase and apache Hbase. Also called No SQL
Benefits oF a Database:
1. Organized data: Keeps information well- organized and easy to find
2. Quick Searches: Allows fast searching and retrieval of data.
3. Data accuracy: Helps ensure that data is correct and consistent.
4. Secure Data: Protects sensitive information with access controls.
5. Easy Updates: Simplifies the process of updating data.
6. Multiple users: Aloows several people to use the database at the same time.
7. Data Backup: Provides easy ways to back up data and prevent loss.
8. Automated Tasks: Can automate routine tasks like sending reminders.
9. Scalability: Grows with your data needs, handling more information over time.
10. Reports and Analysis: Makes it easy to generate reports and analyze data.
Database Managemnent System - An information system that uses a database management system
(DBMS) to manage its information has a particular structure, comprising three components: Data,
DBMS, and Application software.
Example: MySQL
Structured Query Language ( SQL) is a domain- specific language used to manage data, especially in a
relational database management system.
MySQL is an open- source relational database management system. Its name is a combination of “ My”
the name of co-founder Michael Widenius’s daughter My, and “SQL” the acronym for Structured Query
Language.
XAMPP is a free and open source cross platform web server solution stack package developed by
Apache Friends, consisting mainly of the Apache HTTP Server, MariaDB database, and interprets for
scripts written in the PHP and Perl programming languages.
Types of Database:
Single- user: Supports only one user at a time
Desktop: Single- user database running on a personal computer
Multi- user: Supports multiple users at the same time
Workgroup : Multi- user database that supports a small group of users or a single department .
Enterprise: Multi- User database that supports a large group of users or an entire organization.
Location of Database:
Centralized: Supports data located at a single site
Distributed: Supports data distributed across several sites
Data Redundancy
•Data redundancy results in data inconsistency
–Different and conflicting versions of the same data appear in different places
•Errors more likely to occur when complex entries are made in several different files and recur
frequently in one or more files
•Data anomalies develop when required changes in redundant data are not made successfully
Data Anomalies
•Modification anomalies
–Occur when changes must be made to existing records
•Insertion anomalies
–Occur when entering new records
•Deletion anomalies
–Occur when deleting records
ACID rules
Atomicity Consistency Isolation Durability (ACID)
“ ACID RULES “
Atomicity:
- Atomicity is a property that ensures that a database follows the all or nothing rule. In
other words, the database considers all transaction operations as one whole unit or
atom. Thus, when a database processes a transaction, it is either fully completed or not
executed at all. If a single portion of the transaction fails, the whole transaction will fail.
If both operations succeed, the transaction is committed, and the changes are saved to
the database.
If, however, the system crashes after the amount is debited from Account A but before it
is credited to Account B, atomicity ensures that the debit operation is rolled back, so
Account A's balance remains unchanged.
In essence, atomicity guarantees that partial transactions do not leave the database in an
inconsistent state.
- Atomicity is particularly important to mitigate damage in case of database server crashes. If a non-
volatile database crashes in the middle of a transaction, all changes done will be discarded or rolled
back to avoid sending partial results to the production database.
Consistency
- Consistency is a property ensuring that only valid data following all rules and constraints
is written in the database. When a transaction results in invalid data, the database reverts
to its previous state, which abides by all customary rules and constraints.
- Consistency is key to maintain data integrity. All inconsistent data is discarded, and all transactions
that might cause an inconsistency are aborted and an error is created or transcribed into an error log.
For example, if user A wants to withdraw $1,000 from his account, but only has a balance of
$500, consistency will prevent him from withdrawing money and the transaction will be
aborted.
Isolation
-Isolation is a property that guarantees the individuality of each transaction, and prevents them from
being affected from other transactions. It ensures that transactions are securely and independently
processed at the same time without interference, but it does not ensure the order of transactions.
For example, user A withdraws $100 and user B withdraws $250 from user Z’s account, which has a
balance of $1,000. Since both A and B draw from Z’s account, one of the users is required to wait until
the other user transaction is completed, avoiding inconsistent data.
If B is required to wait, then B must wait until A’s transaction is completed, and Z’s account balance
changes to $900. Now, B can withdraw $250 from this $900 balance.
Durability
- Durability is a property that enforces completed transactions, guaranteeing that once each one of
them has been committed, it will remain in the system even in case of subsequent failures.
In the above example, user B may withdraw $100 only after user A’s transaction is completed and is
updated in the database. If the system fails before A’s transaction is logged in the database, A cannot
withdraw any money, and Z’s account returns to its previous consistent state.
Summary
•Information is derived from data, which is stored in a database
•To implement and manage a database, use a DBMS
•Database design defines its structure
•Databases were preceded by file systems
•Because file systems lack a DBMS, file management becomes difficult as a file system grows
•DBMS were developed to address file systems’ inherent weaknesses
•Good design is important