Professional Documents
Culture Documents
DBMS 1 Lecture Slide
DBMS 1 Lecture Slide
Compiled by;
Bashir Ibrahim Baba
&
Adamu Zaharaddeen
The word “Data” is originated from the word “Datum” that means
“single piece of information”. Data is the plural of the word datum.
Data are known facts that can be recorded and have an implicit
meaning. (e.g., names, telephone numbers, addresses, etc.). Data are
raw facts concerning things such as people, objects, or events.
6. Graph Database: It focused equally on the data and the connections between them.
9. Open-Source DB: It is designed for the public to use for free unlike commercial.
R-READ
U-UPDATE and
D-DELETE
NOTE: Database management system is break down into the following;
includes the user of the database and other application programs. It provides an interface
between the data and the software application. Examples of some common databases include;
• MySQL
• Microsoft Access
• Oracle
• PostgreSQL
• dBASE
• FoxPro
• SQLite
• IBM DB2
• LibreOffice Base
• MariaDB
• Microsoft SQL Server etc.
Data plays a very vital role in day-to-day activities of man. Every field of life- ranging
from business, account, banking, insurance, agriculture, energy, industry, science,
engineering, and medicine, Some of the ways by which data has been found to be
useful are as listed below.
3. It is used for the purpose of estimation and prediction of government revenue and
expenditure
6. It is used for making conclusions from data collected in experimental, social and
behavioral research
• Databank
Data Warehouses are central repositories of integrated data from one or more
different sources. They store current and historical data in one single place that
are used for creating analytical reports for workers throughout the enterprise.
Data warehousing is the electronic
07/12/2021 storage of a large amount of information by
School of Health Information Management
(SHIM) ABUTH Tudun Wada, Zaria.
12
• Data Management
Data Management is an administrative process that includes acquiring, validating, storing, and
processing required data to ensure the accessibility, reliability and timeless of the data for its
users.
Data Management: is the practice of collecting, keeping and using data securely, efficiently and
cost effectively.
Data Management is also defined as the process of ingesting (inserting), storing, organizing and
maintaining data created and collected by an organization.
Importance of Data Management
• It improve marketing campaigns
• It optimize business operations
• It reduce costs
• It increase productivity
• It allows information to be shared easily
• It allows information to be stored for future reference and easy retrieval.
School of Health Information Management
07/12/2021 13
(SHIM) ABUTH Tudun Wada, Zaria.
• Data Mining
Data mining is the search for relationships and global patterns that exist in
large databases but are bidden in the vast amounts of data. In data mining, an
analyst combines knowledge of the data with advanced machine learning
technologies to discover nuggets of knowledge hidden in the data. Data
mining software can find meaningful relationships that might take years to
find with conventional techniques. The software is designed to sift through
large collections of data and by using statistical and artificial intelligence
techniques, identify hidden relationships. The mined data typically include
electronic point of patient’s records, inventory, client transactions, and entry
records with matching demographics, usually obtained from an external
source.
1) NOT NULL:
NOT NULL constraint makes sure that a column does not hold NULL value. When
we don’t provide value for a particular column while inserting a record into a table, it
takes NULL value by default. By specifying NULL constraint, we can be sure that a
particular column(s) cannot have NULL values.
School of Health Information Management
07/12/2021 17
(SHIM) ABUTH Tudun Wada, Zaria.
2) UNIQUE:
UNIQUE Constraint enforces a column or set of columns to have
unique values. If a column has a unique constraint, it means that
particular column cannot have duplicate values in a table.
3) DEFAULT:
The DEFAULT constraint provides a default value to a column when
there is no value provided while inserting a record into a table.
4) CHECK:
This constraint is used for specifying range of values for a particular
column of a table. When this constraint is being set on a column, it
ensures that the specified column must have the value falling in the
specified range.
07/12/2021
School of Health Information Management
18
(SHIM) ABUTH Tudun Wada, Zaria.
5) KEY Constraints:
PRIMARY KEY (PK):
Example: From the table below the Stu_Id field is marked as Primary Key,
that means the Stu_Id field cannot have duplicate and null values.
101 Chaitan 22
102 Arya 26
103 Bran 25
104 John 21
School of Health Information Management
07/12/2021 19
(SHIM) ABUTH Tudun Wada, Zaria.
FOREIGN KEY:
Foreign keys are the columns of a table that points to the primary key of
another table. They act as a cross-reference between tables.
In the below example the Stu_id column in Course_enrollment table is a
Foreign Key FK as it points to the Primary Key PK of the Student table.
Student table: Course_enrollment table:
Stu_Id Stu_Name Stu_Age
Course_id Stu_id
101 Chaitan 22 C01 101
102 Arya 26 C02 102
C03 101
103 Bran 25
C04 102
104 John 21
C05 103
C06 102
2. Data Security
3. Data Integration
4. Data Consistency
5. Data Privacy
6. Data Concurrency
7. Data Searching
8. Data Sharing
9. Data Migration
14. Simplicity
07/12/2021
School of Health Information Management
23
(SHIM) ABUTH Tudun Wada, Zaria.
Disadvantages of DBMS
1. Complexity
2. Increased Cost
3. Difficulty
4. Time Consuming
5. Currency Maintenance
6. Huge Size
7. Database Failure
1. Data Redundancy
Unlike traditional file-system storage, Data Redundancy in DBMS is very less or not
present. Data Redundancy occurs when the same data are stored unnecessarily at
different places. Data Redundancy is reduced or eliminated in DBMS because all data
are stored at a centralized location rather than being created by individual users and for
each application.
For e.g. Application A and Application B have the same user MARVEL, and we need
to store personal information about the user such as Name, age, address, Date of Birth
etc. Not to mention, this user has also access to different application, so in traditional
file-based system, there is a need to maintain separate file system for each of the
application to store user’s information while in DBMS approach, there could be just
one centralized location where information can be down streamed to the different
application as and when needed.
School of Health Information Management
07/12/2021 25
(SHIM) ABUTH Tudun Wada, Zaria.
2. Data Consistency
In traditional file system storage, the changes made by one user in one
application doesn’t update the changes in other application, given both have the
same set of details. While this is not the case with DBMS systems as there is a
single repository of data that is defined once and is accessed by many users, and
data are consistent.
3. Data Sharing
In DBMS, Data are stored in one or more servers in the network and that there is
some software locking mechanism that prevents the same set of data from being
changed by two people at the same time.
School of Health Information Management
07/12/2021 27
(SHIM) ABUTH Tudun Wada, Zaria.
7. Data Integration
Data integration is a process of combining the data residing at different
locations and present the user with a unified view of data. DBMS systems
allow Data Integration with much feasibility.
8. Data Access
While in traditional file-based approach, it might take hours to look for very
specific information that might be needed in the context of some business
emergency, while DBMS reduces this time to a few seconds. This is a great
advantage of DBMS because we can write small queries which will search the
Database for you and it will retrieve the information in the fastest way
possible due to its inbuilt searching operations.
There are some data which are access very frequently while there are few that
aren’t. So, DBMS provides the capability to access the frequently accessed
data as quickly as possible.
Though DBMS systems might be costly at the time of purchase but their maintenance
involves a very minimal cost.
With DBMS, one can keep information for thousands of years, provided we don’t see
the doomsday. Data security and very low storage cost (as compared to our previous
generations) in the current century cut any possibility of Data Loss.
An atomic transaction is one in which all of the database actions occur or none of them
do. It is the duty of DBMS to store a complete transaction in the database. If any
transaction is partially completed, then it rolls backs them.
For e.g. If we make an online purchase, money is deducted from our account while if
the purchase is somehow failed, then no money is deducted or if it gets deducted, it
gets returned within few days.
School of Health Information Management
07/12/2021 30
(SHIM) ABUTH Tudun Wada, Zaria.
DISADVANTAGES OF DBMS
1. Increased Cost
To store huge amount of data, one needs huge amount of space. Additionally, it will
require more memory and fast processing power to run the DBMS. So, an expensive
hardware and software will be needed that can provide all these facilities. As a result,
old file-based system needs to be upgraded. These sophisticated hardware and software
require maintenance which is very costly.
DBMS requires high initial investment for hardware and software. A significant
investment based upon size and functionality of organization is required. Also,
organization has to pay concurrent annual maintenance cost.
Sometimes you need a dedicated machine for better performance of database. These
machines and storage space increase extra cost of hardware. Its Licensing, operations,
and regulation compliance cost is also very high.
School of Health Information Management
07/12/2021 31
(SHIM) ABUTH Tudun Wada, Zaria.
b.) Increased Cost of Staff
DBMS staff includes database administrator, application programmers,
Database designers, System Analyst and maintenance personals. All of these
are highly educated and experienced in the field of DBMS. To get this level of
experienced people, one needs to spend a lot of money. Also training of
DBMS is very costly.
A DBMS fulfill lots of requirement and it solves many problems related to database.
But all these functionalities make DBMS an extremely complex software. Developers,
designers, DBA and End users of database must have complete skills of DBMS if they
want to use it properly.
If they don’t understand this complex system then it may cause loss of data or database
failure. As it requires lots of management, so its complexity becomes an issue and very
big disadvantage of DBMS.
Organizations have many employees working for them and these employees can
perform many other tasks too that are not in their domain but it is almost impossible for
them to work on DBMS.
A dedicated team of technical staff is required who can handle DBMS and as a result,
company have to pay handsome salary to them too.
School of Health Information Management
07/12/2021 33
(SHIM) ABUTH Tudun Wada, Zaria.
4. Database Failure
Data is the key for any organization, if data is lost then whole organization
will collapse. And as we know that in DBMS, all the files are stored in single
database so chances of database failure become more.
Any accidental failure of component may cause loss of valuable data. This is
really a big question mark for big firms and they are continuously working to
solve this issue.
5. Huge Size
DBMS is made to handle extremely huge data and queries, but due its
complexity, DBMS has become huge in size. Also, it becomes bigger in size
as data is fed in it. As a result, it requires lots of space and memory to run its
application efficiently.
If information from the data centre gets corrupted then every user of the
organization will be in a big trouble.
9. Data Integrity
There are many software and application programs that are made only for one particular problem.
But DBMS is a multi-use software that is used for many purposes and as a result it becomes less
efficient.
Specialized software is more efficient because they are produced and optimized for one problem.
As DBMS is capable of many things because it is centralized, but at the same time centralization
increases vulnerability. The whole system shuts down due to the failure of a single component.
This is very critical disadvantage of DBMS for those organizations that are totally dependent of
database.
12. Performance
Traditional files system was very good for small organizations as it gave splendid performance.
But DBMS gives poor performance for small scale firms as its speed is slow and due that it is well
suited for big firms.
4. Sophisticated Users
Sophisticated users can be engineers, scientists, business analyst, who are
familiar with the database. They can develop their own data base applications
according to their requirement. They don’t write the program code but they
interact the data base by writing SQL queries directly through the query
processor.
(DBA) is the person who ensures that the bank teller has easy, fast access to
your information, and can quickly access your bank balance and transaction
databases.
There are different kinds of DBA depending on the responsibility that he owns.
maintaining DBMS servers. His prime tasks are installing, backups, recovery,
b) Development DBA – He is responsible for creating queries and procedure for the
maintaining the users, roles, access rights, tables, views, constraints and indexes.
e) Application DBA –He acts like a bridge between the application program and
the database. He makes sure all the application program is optimized to interact
with the database. He ensures all the activities from installing, upgrading, and
patching, maintaining, backup, recovery to executing the records works
without any issues.
database structures for the organization. Basically, the DBA keeps databases and
installing a new DBMS server for the new projects. He is also responsible for
upgrading these servers as there are new versions comes in the market or
should be able revert the new changes back to the older version, thus
maintaining the DBMS working. He is also responsible for updating the service
3. Performance tuning: – Since database is huge and it will have lots of tables,
data, constraints and indices, there will be variations in the performance from
time to time. Also, because of some designing issues or data growth, the database
will not work as expected. It is responsibility of the DBA to tune the database
performance. He is responsible to make sure all the queries and programs works
in fraction of seconds.
4. Migrate database servers: – Sometimes, users using oracle would like to shift
to SQL server or Netezza. It is the responsibility of DBA to make sure that
migration happens without any failure, and there is no data loss.
developed by DBA and has to be maintained him. This is one of the main
there is any crash, it should be recovered without much effort and data loss.
6. Security: – DBA is responsible for creating various database users and roles,
that if he quits or any new DBA comes in, he should be able to understand the
database without any effort. He should basically maintain all his installation,
database performance.
School of Health Information Management
07/12/2021 51
(SHIM) ABUTH Tudun Wada, Zaria.
DBMS USER INTERFACE
A database management system (DBMS) interface is a user interface which
allows for the ability to input queries to a database without using the query
language itself. A DBMS interface could be a web client, a local client that
runs on a desktop computer, or even a mobile app.
A database management system stores data and responds to queries using a
query language, such as SQL. A DBMS interface provides a way to query data
without having to use the query language, which can be complicated.
DBMS Interfaces:-
i. Menu based interfaces:- These interfaces presents the user with list of
option called menus. Pull down menus are the very important technique.
iv. Forms base interfaces: - These interface displays a form to each user.
users can fill out all the entries to insert new data.
A data source is simply the source of the data. It can be a file, a particular
database on a DBMS, or even a live data feed. The data might be located on the
same computer as the program, or on another computer somewhere on a network.
For example, a data source might be an Oracle DBMS running on an OS/2
operating system, accessed by Novell Netware; an IBM DB2 DBMS accessed
through a gateway; a collection of Xbase files in a server directory; or a local
Microsoft Access database file.
A data source is the location where data that is being used come from. In a
database management system, the primary data source is the database, which can
be located in a disk or a remote server. The data source for a computer program
can be a file, a data sheet, a spreadsheet, an XML file or even hard-coded data
within the program.
School of Health Information Management
07/12/2021 54
(SHIM) ABUTH Tudun Wada, Zaria.
The purpose of a data source is to gather all of the technical information needed
to access the data - the driver name, network address, network software, and so
on - into a single place and hide it from the user. The user should be able to look
at a list that includes Payroll, Inventory, and Personnel, choose Payroll from the
list, and have the application connect to the payroll data, all without knowing
where the payroll data resides or how the application got to it.
DATABASE DATA TYPE
A database data type refers to the format of data storage that can hold a distinct
type or range of values. When computer programs store data in variables, each
variable must be designated a distinct data type. Some common data types are
as follows: integers, characters, strings, floating point numbers and arrays. More
specific data types are as follows: varchar (variable character) formats, Boolean
values, dates and timestamps.
School of Health Information Management
07/12/2021 55
(SHIM) ABUTH Tudun Wada, Zaria.
When defining the fields in a database table, we must give each field a data
type. For example, the field Birth Year is a year, so it will be a number, while
First Name will be text. Most modern databases allow for several different
data types to be stored. Some of the most common data types are listed here:
• Text: for storing non-numeric data that is brief, generally under 256
characters. The database designer can identify the maximum length of the
text.
• Number: for storing numbers. There are usually a few different number
types that can be selected, depending on how large the largest number will
be.
• Yes/No: a special form of the number data type that is (usually) one byte
long, with a 0 for “No” or “False” and a 1 for “Yes” or “True”.
3. Relational databases
4. Object-oriented databases
5. Cloud Databases
Root
Level 1 Level 1
Child Child
University
Department Infrastructure
Theory Labs
DISADVANTAGE
This type of database structure is that each child in the tree may have
only one parent. Relationships or linkages between children are not
permitted, even if they make sense from a logical standpoint.
Hierarchical databases are like this in their design. Adding a new field
or record requires that the entire database be redefined.
Instructions, or software programs called methods, for what to do with the data.
The benefits of object-oriented databases are compelling. The ability to mix and match
reusable objects provides the incredible multimedia capability.
Most organizations are unwilling to abandon and convert from those databases.
School of Health Information Management
07/12/2021 73
(SHIM) ABUTH Tudun Wada, Zaria.
5) CLOUD DATABASE
over the cloud computing platform. It provides users with various cloud
computing services (SaaS, PaaS, IaaS, etc.) for accessing the database. There
• Microsoft Azure
• Kamatera
• PhonixNAP
• ScienceSoft
1. Stores the definitions of data and their relationships (metadata) in a data dictionary;
any changes made are automatically recorded in the data dictionary.
5. Creates complex structures that allow multiple user access to the data.
8. Provides access to the data via utility programs and from programming languages
interfaces.
9. Provides end-user access to data within a computer network environment.
School of Health Information Management
07/12/2021 75
(SHIM) ABUTH Tudun Wada, Zaria.
RELATIONSHIPS
Most databases are divided into many tables, most of which are related to one
another. In most modern databases, such as the relational database, relationships are
established through the use of primary and foreign keys. The purpose of separating
data into tables and establishing table relationships is to reduce data redundancy.
1. Bits (characters)
2. Fields
3. Records
4. Files
5. Databases
School of Health Information Management
07/12/2021 79
(SHIM) ABUTH Tudun Wada, Zaria.
1. Bit (Character) - a bit is the smallest unit of data
representation (value of a bit may be a 0 or 1). Eight bits
make a byte which can represent a character or a special
symbol in a character code.
2. Field - a field consists of a group of characters. A data field
represents an attribute (a characteristic or quality) of some
entity (object, person, place, or event).
3. Record - a record represents a collection of attributes that
describe a real-world entity. A record consists of fields, with
each field describing an attribute of the entity.
Whether your database server is on-premise or in a cloud data center, it must be located
within a secure, climate-controlled environment. (If your database server is in a cloud data
center, your cloud provider will take care of this for you.)
2) Authentication/ Authorization
5) Backups
A data backup, as part of your database security protocol, makes a copy of your data and stores it
on a separate system. This backup allows you to recover lost data that may result from hardware
failures, data corruption, theft, hacking, or natural disasters.
6) Encryption
Encryption is encoding process of sensitive data to become unreadable. Most of relational
database management systems support this purpose to secure its data.
School of Health Information Management
07/12/2021 85
(SHIM) ABUTH Tudun Wada, Zaria.
DATABASE BACKUP AND RECOVERY
Database Backup is storage of data that means the copy of the data. It is
a safeguard against unexpected data loss and application errors. It
protects the database against data loss. If the original data is lost, then
using the backup it can be reconstructed.
1. Physical Backups
Physical Backups are the backups of the physical files used in storing
and recovering your database, such as data files, control files and
archived redo logs, log files. It is a copy of files storing database
information to some other location, such as disk, some offline storage
like magnetic tape. Physical backups are the foundation of the recovery
mechanism in the database. Physical backup provides the minute details
about the transaction and modification to the database.
School of Health Information Management
07/12/2021 87
(SHIM) ABUTH Tudun Wada, Zaria.
2. Logical backup
Logical Backup contains logical data which is extracted from a
database. It includes backup of logical data like views, procedures,
functions, tables, etc. It is a useful supplement to physical backups in
many circumstances but not a sufficient protection against data loss
without physical backups, because logical backup provides only
structural information.
• Network Failure
• Disk Failure
• Media Failure
Disk Failure occurs when there are issues with hard disks like
formation of bad sectors, disk head crash, unavailability of disk etc.
5. Media Failure
Media failure is the most dangerous failure because, it takes more time
to recover than any other kind of failures. A disk controller or disk head
crash is a typical example of media failure. Natural disasters like
floods, earthquakes, power failures, etc. damage the data.
To avoid data loss in the secondary memory, there are three
methods used to back it up: