0% found this document useful (0 votes)
2 views

database

Chapter 9 covers the competencies required for managing database systems, including identification, design, creation, manipulation, testing, implementation, transaction management, and security. It outlines key learning outcomes, such as identifying database management systems, designing databases, and performing operations using SQL. The chapter also provides detailed information on various database models, operations, and self-assessment questions to reinforce understanding.

Uploaded by

mysaustine1
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

database

Chapter 9 covers the competencies required for managing database systems, including identification, design, creation, manipulation, testing, implementation, transaction management, and security. It outlines key learning outcomes, such as identifying database management systems, designing databases, and performing operations using SQL. The chapter also provides detailed information on various database models, operations, and self-assessment questions to reinforce understanding.

Uploaded by

mysaustine1
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 27

CHAPTER 9: DATABASE MANAGEMENT SYSTEM

9.1 Introduction

This unit specifies competencies required to manage database system. They include
identification of database management systems, designing of database, Creation and
manipulation of database, database testing e.g. using dummy data, implementation of the
designed database, establishing transaction and concurrency mechanism and managing
database security

9.2 Performance Report

o Established Database requirements


o Identified database components
o Adopted a Suitable database system
o Performed Database operations
o Applied Appropriate Data Attributes
o Extracted data from database using SQL
o Performed test data and validated the results
o Identified transaction and concurrency mechanisms
om

o Established restrictions to the database


t.c
ve
yt

9.3 Learning Outcome


s
ea

9.3.1 List of the Learning Outcomes

These are the key learning outcomes, which make up workplace function:
o Identify database management system
o Design database
o Create and manipulate database
o Perform database testing
o Implement designed database
o Establish transaction and concurrency mechanism
o Manage database security

181
9.3.2 Learning Outcome 1: Identify database management system

9.3.2.1 Learning Activities


The following are the performance criteria:
o Database requirements are established based on user needs.
o Main features in databases are identified according to expected output.
o Database components are identified
o Classification and categories of databases is done
o Functionality of databases is identified as per the requirements
o Suitable database system is adopted as per user requirements

Trainees to demonstrate knowledge in relation to:


o Define database management system, components and terminologies
o Classification of databases
o Understand various database management system

9.3.2.2 Information Sheet

A database management system (DBMS) is a software package designed to define,


manipulate, retrieve and manage data in a database. A DBMS generally manipulates the data
om

itself, the data format, field names, record structure and file structure. It also defines rules to
t.c

validate and manipulate this data. A DBMS relieves users of framing programs for data
ve
yt

maintenance. Fourth-generation query languages, such as SQL, are used along with the
s
ea

DBMS package to interact with a database.

Some other DBMS examples include: MySQL, SQL Server, Oracle, dBASE, FoxPro

Classification based on Data Model: The most popular data model in use today is the
relational data model. Well-known DBMSs like Oracle, MS SQL Server, DB2 and MySQL
support this model.

• Centralized database system: the DBMS and database are stored at a single site that is
used by several other systems.
• Distributed database system: the actual database and the DBMS software are distributed
from various sites that are connected by a computer network
• Heterogeneous distributed database system: different sites might use different DBMS
software, but there is additional common software to support data exchange between
these sites
• Homogeneous distributed database systems: use the same DBMS software at multiple
sites
• Multiuser database system: a database management system, which supports multiple
users concurrently
• Object-oriented data model: a database management system in which information is

182
represented in the form of objects as used in object-oriented programming
• Single-user database system: a database management system which supports one user at
a time
• Traditional models: data models that preceded the relational model

Read: Classification of databases: https://opentextbc.ca/dbdesign01/chapter/chapter-6-


classification-of-database-systems/

9.3.2.3 Self-Assessment
i. What is database management?
ii. Explain database classification?
iii. What is the difference between centralized and distributed database systems?
iv. What is the difference between homogenous distributed database systems and
heterogeneous distributed database systems?
v. Provide three examples of the most popular relational databases used.
vi. DBMS is software.
A. True
B. False
vii. DBMS manages the interaction between __________ and database.
A. Users
om

B. Clients
t.c
ve

C. End Users
yt

D. Stake Holders
s
ea

viii. Database is generally __________


A. System-centered
B. User-centered
C. Company-centered
D. Data-centered
ix. Which of the following is not involved in DBMS?
A. End Users
B. Data
C. Application Request
D. HTML
x. As database administrator how will you explain the primitive operations common to
all record management System?

9.3.2.4 Tools, Equipment, Supplies and Materials


MySQL, SQL Server, Oracle, dBASE, computer

9.3.2.5 References
• https://www.techopedia.com/definition/24361/database-management-systems-dbms
• https://opentextbc.ca/dbdesign01/chapter/chapter-6-classification-of-database-systems/

183
• Database Systems: Design, Implementation, & Management 12th Edition authored by
Steven Morris, Carlos Coronel, published by Cengage Learning; 12 edition 2016

9.3.3 Learning Outcome 2: Design database

9.3.3.1 Learning Activities


The following are the performance criteria:
o Appropriate database structures are determined
o Database design is implemented based on requirements.
o Database modeling is done as per the design implemented
o Database operations are performed

Trainees to demonstrate knowledge in relation to:


o Define data abstraction, instances and schemas
o Types of Database structures
o Database operations: INSERT, SELECT, UPDATE, DELETE
o Data models : ER- Models, Relational Models, Hierarchical models, Network Models

9.3.3.2 Information Sheet


om

Data abstraction is the reduction of a particular body of data to a simplified representation


t.c

of the whole. Abstraction, in general, is the process of taking away or removing


ve
yt

characteristics from something in order to reduce it to a set of essential characteristics.


s
ea

Instance: The data stored in database at a particular moment of time is called instance of
database. Database schema defines the variable declarations in tables that belong to a
particular database; the value of these variables at a moment of time is called the instance of
that database.

Types of database models


o Hierarchical database model
o Relational model
o Network model
o Object-oriented database model
o Entity-relationship model
o Document model
o Entity-attribute-value model
o Star schema

Read: Database model: https://www.lucidchart.com/pages/database-diagram/database-


models

184
A database operation is the vehicle through which users and applications have access
to data in relational databases. Each database operation accesses one relational database.

om
t.c
ve
syt
ea

Source: https://slideplayer.com
Figure 74: User database operations

The INSERT INTO statement is used to insert new records in a table:


INSERT INTO table_name (column1, column2, column3, …)
VALUE (value1, value2, value3, ….)

The SELECT statement is used to select data from a database:


SELECT (column1, column 2,…)
FROM table_name

The UPDATE statement is used to modify the existing records in a table:


UPDATE table_name
SET column1= value1, column2 = value2, …
WHERE condition;

The DELETE statement is used to delete existing records in a table:


DELETE FROM table_name WHERE condition;

185
Watch: MySQL queries: https://youtu.be/XMY6Wt1NREg

Data Models are fundamental entities to introduce abstraction in a DBMS.

om
t.c
ve
yt
s
ea

Source: https://www.guru99.com
Figure 75: Data Model

186
An entity–relationship model (or ER model) describes interrelated things of interest in a
specific domain of knowledge. A basic ER model is composed of entity types (which
classify the things of interest) and specifies relationships that can exist between entities
(instances of those entity types).

om
t.c
ve
yt
s
ea

Source: http://jcsites.juniata.edu
Figure 76: Entity-relationship model

187
In the relational model, all data must be stored in relations (tables), and each relation
consists of rows and columns.

om
t.c
ve
yt
s
ea

Source: https://en.wikipedia.org
Figure 77: Relation model

188
Hierarchical Models (aka Hierarchical Linear Modelsor HLM) are a type of linear
regression models in which the observations fall into hierarchical, or completely nested
levels. Hierarchical Models are a type of Multilevel Models.

Level 1 Level 2 Level 3

Classification 1
2nd level
classification 1
Classification 2

1st level 2nd level


classification classification 2 Classification 1
om

Classification 1
t.c

2nd level
ve

classification 3
yt
s

Classification 2
ea

Figure 78: Hierarchical model

189
A network model is a database model that is designed as a flexible approach to representing
objects and their relationships. A unique feature of the network model is its schema, which is
viewed as a graph where relationship types are arcs and object types are nodes.

om

Source: http://www.dbmsinternals.com
t.c

Figure 79: Network model


ve
syt
ea

9.3.3.3 Self-Assessment
i. Write a SQL query to fetch all records FROM table?
ii. Write a SQL query to create a new table with data and structure copied from another
table?
iii. Who proposed the relational model?
vi. Define database model.
v. What is the purpose of SQL?
vi. What is DBMS used for?
vii. What is E-R model in the DBMS?
viii. Which SQL function is used to count the number of rows in a SQL query ?
A. COUNT()
B. NUMBER()
C. SUM()
D. COUNT(*)
ix. What mode of authentication does SQL Server NOT provide?
A. Windows-only security
B. Both SQL Server and Windows-only security
C. Mixed security
D. SQL Server only security
x. If you don’t specify ASC or DESC after a SQL ORDER BY clause, the following is
used by default

190
A. ASC
B. DESC
C. There is no default value
D. None of the mentioned
xi. Which of the following statement is true?
A. DELETE does not free the space containing the table and TRUNCATE free the
space containing the table
B. Both DELETE and TRUNCATE free the space containing the table
C. Both DELETE and TRUNCATE does not free the space containing the table
D. DELETE free the space containing the table and TRUNCATE does not free the
space containing the table

9.3.3.4 Tools, Equipment, Supplies and Materials


SQL Server Database Modeler, Aqua Data Studio ER Modeler, Computer

9.3.3.5 References
• https://www.w3schools.com/sql/default.asp
• https://www.softwaretestinghelp.com/database-design-tools/
• Database Systems: Design, Implementation, & Management 12th Edition authored by
Steven Morris, Carlos Coronel, published by Cengage Learning; 12 edition 2016
om

• SQL QuickStart Guide: The Simplified Beginner's Guide To SQL authored by


t.c
ve

ClydeBank Technology published by CreateSpace Independent Publishing Platform 2015


yt
s
ea

9.3.4 Learning Outcome 3: Create and manipulate database

9.3.4.1 Learning Activities


The following are the performance criteria:
o Appropriate data Attributes are applied appropriately
o Data relationships are established as per the tables created
o Model and index of the data is done.
o Data is extracted from database using SQL

Trainees to demonstrate knowledge in relation to:


Creation of tables, Primary and secondary key
Linking of tables, Data variables, Database integration, Database Querying-SQL

9.3.4.2 Information Sheet


Tables can be created using CREATE TABLE statement and it actually has the following
syntax:
CREATE TABLE [IF NOT EXISTS} `TableName` (`filename` dataType [optional
parameters] ENGINE = storage Engine;

191
One is selected as the primary key. Those not selected are known as secondary keys. For
example, an employee has an employee number, a National Insurance (NI) number and an
email address. If the employee number is chosen as the primary key then the NI number and
email address are secondary keys.

om
t.c
ve

Source: https://www.researchgate.net
yt
s

Figure 80: Database table


ea

Linking of table is a very common requirement in SQL. Different types of data can be stored
in different tables and based on the requirement the tables can be linked to each other and the
records can be displayed in a very interactive way.

Source: https://www.plus2net.com
Figure 81: Table linkages

A variable is any characteristics, number, or quantity that can be measured or counted.


A variable may also be called a data item. Age, sex, business income and expenses, country

192
of birth, capital expenditure, class grades, eye colour and vehicle type are examples
of variables.

An integration database is a database, which acts as the data store for multiple applications,
and thus integrates data across these applications (in contrast to an Application Database).
An integration database needs a schema that takes all its client applications into account.

om
t.c
ve
syt
ea

Source: https://en.wikipedia.org/wiki/Data_integration
Figure 82: Integration of database

SQL is a domain-specific language used in programming and designed for managing data
held in a relational database management system, or for stream processing in a relational data
stream management system.

Watch: SQL Queries: https://www.coursera.org/lecture/core-database/part-1-sql-query-


language-vevDZ

9.3.4.3 Self-Assessment
i. How to create table?
ii. What is table linkage?
iii. Define data variable?
iv. What the difference between primary key and secondary key?
v. What is SQL?
vi. A medical Centre wishes to computerize all its patients’ records
a) Create database for the Centre and save it as your name and personal number.

193
b) InDesign View, Create a table with the following properties and save it as patient
Bio Table.
Field Name Properties
Patient Name Text (20)
Sex Text (1)
Residence Text (20)
Patient code Text (4)
Date of visit Date/Time(short date)
Diagnosis Text (25)

c) Create a form for patient Bio table and enter the records below, save it as patient
bio form
Patient Name Sex Residence Patient Date of Diagnosis
Code visit
Victor sam M Kangemi ADS011 3/8/2018 Septic
Wound
Stella mugo F Kisumu ADS025 9/1/2019 Malaria
Mwangi Nema F Buru buru ADS014 23/4/2018 Inflamed
joints
Njambi ella F Bulenga ADS034 14/2/2019 Infections
om

in chest
t.c
ve

Michael wanyama M Naivasha ADS019 3/2/2019 Malaria


yt
s
ea

d) InDesign view, create another table with the following properties and save it as
patient billing Table.
Field Name Properties
Patient Code Text (4), Primary Key
Prescription Memo
Consult_fee Number
Treat_fee Number
Medical bill Number
Medical is a calculated field which is Consult_fee+ Treat_fee

e) Populate the Patient Billing Table with the following Data;


Patient Code Prescription Consult_fee Treat_fee Medical bill
ADS011 Coartem 17,000 28,000
ADS025 Tetanous 17,000 20,000
ADS014 Ciproflaxin 17,000 25,000
tabs, PPF
ADS034 Chloroquine 17,000 17,000
Infection
ADS019 Referref 17,000 8,000

194
f) Create a one-to-one relationship between the Patient Bio Table and the Patient
Billing Table.
g) Create a query which extract from patient bio table only those patients who were
not diagnosed with malaria. Save it as anti-malaria.
h) i.) Create a report showing Name, Residence, Prescription and Medical Bill. Save
it as clinic report.
ii.) Include a report footer of your name and personal number.
iii.) Print all your work.
vii. A logical schema is -
A. Is the entire database
B. Describe data in terms of relational tables and columns, object-oriented classes,
and XML tags
C. Describes how data is actually stored on disk.
D. Both (A) and (C)
vii. The database environment has all of the following components except:
A. Users.
B. Separate files
C. Database.
D. Database administrator
viii. The way a particular application views the data from the database that the application
om

uses is a
t.c

A. Module.
ve
yt

B. Relational model.
s
ea

C. Schema.
D. Sub schema.
ix. Which is the subset of SQL commands to manipulate Oracle Database structures,
including tables,
A. Data Definition Language (DDL)
B. Data Manipulation Language (DML)
C. Both of above
D. None

9.3.4.4 Tools, Equipment, Supplies and Materials


MySQL, Computer

9.3.4.5 References
• https://www.guru99.com/how-to-create-a-database.html
• https://www.plus2net.com/sql_tutorial/sql_linking_table.php
• https://www.coursera.org/lecture/core-database/part-1-sql-query-language-vevDZ
• Database Systems: Design, Implementation, & Management 12th Edition authored by
Steven Morris, Carlos Coronel, published by Cengage Learning; 12 edition 2016
• SQL QuickStart Guide: The Simplified Beginner's Guide To SQL authored by
ClydeBank Technology published by CreateSpace Independent Publishing Platform 2015

195
9.3.5 Learning Outcome 4: Perform database testing

9.3.5.1 Learning Activities


The following are the performance criteria:
o Test data is prepared according to the database design
o Run the test data based on the expected output
o Check the test results based on the clients needs
o Validate the results
o Report the findings

Trainees to demonstrate knowledge in relation to:


o Integration testing, DB Query testing, Database test techniques
o Schema testing, Stored procedure, Trigger, Stress, Views, Benchmarking etc.
o Perform database testing, Generate test report

9.3.5.2 Information Sheet

Integration testing is a level of software testing where individual units are combined
and tested as a group. The purpose of this level of testing is to expose faults in the interaction
between integrated units. Test drivers and tests tubs are used to assist in Integration Testing.
om
t.c

Database Testing is checking the schema, tables, triggers, etc. of the database under test. It
ve
yt

may involve creating complex queries to load/stress test the database and check its
s
ea

responsiveness it. It also checks data integrity and consistency.

Database Schema Testing: As mentioned earlier, it involves testing each object in the
Schema.

Verifying Databases and devices:


o Verifying the name of database
o Verifying the data device, log device and dump device
o Verifying if enough space allocated for each database
o Verifying database option setting

Stored Procedure Tests


It involves checking whether a stored procedure is defined and the output results are
compared. In a Stored Procedure test, the following points are checked:
o Stored procedure name
o Parameter names, parameter types, etc.
o Output − whether the output contains many records. Zero rows are affected or only a few
records are extracted.
o What is the function of Stored Procedure and what a stored procedure is not supposed to
do?
o Passing sample input queries to check if a stored procedure extracts correct data.

196
o Stored Procedure Parameters: Call stored procedure with boundary data and with valid
data. Make each parameter invalid once and run a procedure.
o Return values: Check the values that are returned by stored procedure. In case of a failure,
nonzero must be returned.
o Error messages check: Make changes in such a way that the stored procedure fails and
generate every error message at least once. Check any exception scenarios when there is
no predefined error message.

In a Trigger test, the tester must perform the following tasks −


o Make sure the trigger name is correct.
o Validate the trigger if it is generated for a specific table column.
o Trigger’s update validation.
o Update a record with a valid data.
o Update a record with invalid data and cover every trigger error.
o Update a record when it is still referenced by a row in other table.
o Ensure rolling back transactions when a failure occurs.
o Find out any cases in which a trigger is not supposed to roll back transactions.

Stress Testing involves getting a list of major database functions and corresponding stored
procedures. Follow the steps given below for Stress Testing:
om

o Write test scripts to try those functions and every function must be checked at least once
t.c

in a full cycle.
ve
yt

o Perform the test scripts again and again for a specific time period.
s
ea

o Verifying the log files to check any deadlocks, failure out of memory, data corruption,
etc.

Benchmark Testing
If your database does not have any data problems or bugs, system performance can be
checked. A poor system performance can be found in benchmark testing by checking the
parameters given below:
o System level performance
o Identify most-likely-used functions/features
o Timing – maximum time, minimum time and average time to perform functions
o Access volume

Database tests are typically a three-step process:


o Setup the test. You need to put your database into a known state before running tests
against it.
o Run the test. Using a database regression-testing tool, run your database tests just like you
would run your application tests.
o Check the results.

197
9.3.5.3 Self-Assessment
i. What is database testing?
ii. Differentiate trigger testing and stress testing?
iii. When you are testing database, what do you need to check normally as an IT
technician?
iv. How would you know for database testing, whether trigger is fired or not?
v. While testing stored procedures what are the steps does a tester takes?
vi. _________ involves getting a list of major database functions and corresponding
stored procedures.
A. Benchmark Testing
B. Stress Testing
C. Trigger test
D. None
vii. Trigger testing which tasks tester must perform?
A. Make sure the trigger name is correct.
B. Validate the trigger if it is generated for a specific table column.
C. Trigger’s update validation.
D. Update a record with a valid data.
E. Both of above
F. None of above
om

viii. __________ is checking the schema, tables, triggers.


t.c

A. Database Testing
ve
yt

B. Database Schema Testing


s
ea

C. Benchmark Testing
D. None of above

9.3.5.4 Tools, Equipment, Supplies and Materials


LINQ, SP Test tool

9.3.5.5 References
• https://www.guru99.com/data-testing.html
• https://www.tutorialspoint.com/database_testing/database_testing_techniques.htm
• Database Systems: Design, Implementation, & Management 12th Edition authored by
Steven Morris, Carlos Coronel, published by Cengage Learning; 12 edition 2016

198
9.3.6 Learning Outcome 5: Implement designed database

9.3.6.1 Learning Activities


The following are the performance criteria:
o Scope is defined as per the design
o Organize database project according to time frame
o Select database management system products
o Develop initial implementation plan and schedule
o Design the database
o Install and test database
o Develop detailed conversion plan
o Convert existing applications
o Fine tune the database
o Perform training
o Periodically review database performance

Trainees to demonstrate knowledge in relation to:


o Run the designed database
o Test the design and database functionality
om

9.3.6.2 Information Sheet


t.c
ve
yt

The design process:


s
ea

The design process consists of the following steps:


o Determine the purpose of your database

This helps prepare you for the remaining steps.


o Find and organize the information required: Gather all of the types of information you
might want to record in the database, such as product name and order number.
o Divide the information into tables: Divide your information items into major entities or
subjects, such as Products or Orders. Each subject then becomes a table.
o Turn information items into columns: Decide what information you want to store in
each table. Each item becomes a field, and is displayed as a column in the table. For
example, an Employees table might include fields such as Last Name and Hire Date.
o Specify primary keys: Choose each table’s primary key. The primary key is a column
that is used to uniquely identify each row. An example might be Product ID or Order ID.
o Set up the table relationships: Look at each table and decide how the data in one table is
related to the data in other tables. Add fields to tables or create new tables to clarify the
relationships, as necessary.
o Refine your design: Analyze your design for errors. Create the tables and add a few
records of sample data. See if you can get the results you want from your tables. Make
adjustments to the design, as needed.
o Apply the normalization rules: Apply the data normalization rules to see if your tables
are structured correctly. Make adjustments to the tables, as needed.

199
Database Testing is checking the schema, tables, triggers, etc. of the database under test. It
may involve creating complex queries to load/stress test the database and check its
responsiveness. It checks data integrity and consistency.

Non-
Structural Functional Functional
Testing Testing
Testing

Source: www.guru99.com
Figure 83: Types of database testing

9.3.6.3 Self-Assessment
i. What is database testing?
ii. Explain design process of database?
iii. ________ choose each table’s primary key. The primary key is a column that is used
to uniquely identify each row. An example might be Product ID or Order ID.
A. Refine your design
om

B. Specify primary keys


t.c

C. The design process


ve
yt

D. None of Above
s
ea

E. Both of above
iv. Analyze your design for errors. Create the tables and add a few records of sample
data. See if you can get the results you want from your tables. Make adjustments to
the design, as needed.
A. Refine your design
B. The design process
C. None of above
D. Both A and B
E. Apply the normalization rules
v. An enterprise data model is a relational model that shows the high-level entities for
the organization and associations among those entities.
A. True
B. False
vi. Term that is considered as a basis for most robust authentication schemes, is said to
be
A. Identification
B. Registration
C. Encryption
D. Refine information

200
9.3.6.4 Tools, Equipment, Supplies and Materials
Computer, Data Factory, MockupData, SQL Server

9.3.6.5 References
• https://support.office.com/en-us/article/database-design-basics-eb2159cf-1e30-401a-
8084-bd4f9c9ca1f5
• https://www.guru99.com/data-testing.html
• Database Systems: Design, Implementation, & Management 12th Edition authored by
Steven Morris, Carlos Coronel, published by Cengage Learning; 2016

9.3.7 Learning Outcome 6: Establish transaction and concurrency mechanism

9.3.7.1 Learning Activities


The following are the performance criteria:
o Transaction mechanisms used in database management system are identified
o Management of multiple transactions in database management system are identified

Trainees to demonstrate knowledge in relation to:


o Transaction mechanisms
o Concurrency mechanisms
om

o Management of multiple transactions


t.c
ve
yt

9.3.7.2 Information Sheet


s
ea

Transaction mechanisms occur if the transaction does not complete successfully, a


ROLLBACK statement returns the data to the state it was in prior to the beginning of the
transaction. If the transaction completes successfully, a COMMIT statement permanently
stores the data in the database.

Due to the nature of SQL and relational database architecture, where each update can act on
only one table at a time and where there are no trailers in the usual sense, two update
statements must be executed simultaneously. Both update statements must either succeed and
COMMIT or fail and ROLLBACK.

In a transaction a group of updates must either COMMIT or ROLLBACK together. First a


transaction is declared, and then either the COMMIT or the ROLLBACK SQL statement is
issued for all the statements that have been issued since the transaction declaration.

Concurrency mechanism ensures that database transactions are performed concurrently


without violating the data integrity of the respective databases. Thus concurrency control is
an essential element for correctness in any system where two database transactions or more,
executed with time overlap, can access the same data.

201
om
t.c
ve
yt
s

Source: www.guru99.com
ea

Figure 84: Concurrency mechanism

Managing Multiple Transactions. Transaction management is used to maintain the integrity


of a data source when operations on one or more data sources need to be treated as a single
operation. The most common example of transaction management comes from banking.

Source: Tutorials4us.com
Figure 85: Transaction management

202
9.3.7.3 Self-Assessment
i. What is transaction mechanism?
ii. Differentiate between transaction mechanism and concurrency mechanism?
iii. What is managing multiple transactions?
iv. Any non-serial interleaving of T1 and T2 for concurrent execution leads to
A. A serializable schedule
B. A schedule that is not conflict serializable
C. A conflict serializable schedule
D. A schedule for which a precedence graph cannot be drawn
v. Which of the following locks the item from change but not from read?
A. Implicit lock
B. Explicit lock
C. Exclusive lock
D. Shared lock
vi. A transaction in which either all of the database actions occur or none of them do is
called:
A. Atomic
B. Consistent
C. Isolated
D. Durable
om

vii. Which of the following occurs when one transaction reads a changed record that has
t.c

not been committed to the database?


ve
yt

A. No repeatable read
s
ea

B. Phantom read
C. Dirty read
D. Consistent read

9.3.7.4 Tools, Equipment, Supplies and Materials


Computer, MySQL

9.3.7.5 References
• http://ftp.magicsoftware.com/www/help/uniPaaS/mergedprojects/MGHELPW/Data_Man
agement/SQL_Considerations/Transaction_Mechanism.htm
• Database Systems: Design, Implementation, & Management 12th Edition authored by
Steven Morris, Carlos Coronel, published by Cengage Learning; 2016

203
9.3.8 Learning Outcome 7: Manage database security

9.3.8.1 Learning Activities


The following are the performance criteria:
o Restriction of access to the database is established
o Backup and recovery methods are identified and implemented.

Trainees to demonstrate knowledge in relation to:


o Restriction of access as per Internal policy
o Types of restrictions
o Backup and recovery methods

9.3.8.2 Information Sheet


Database security is generally planned, implemented and maintained by a database
administrator and or other information security professional.

Some of the ways database security is analyzed and implemented include:


o Restricting unauthorized access and use by implementing strong and multifactor access
and data management controls
o Load/stress testing and capacity testing of a database to ensure it does not crash in a
om

distributed denial of service (DDoS) attack or user overload


t.c

o Physical security of the database server and backup equipment from theft and natural
ve
yt

disasters
s
ea

o Reviewing existing system for any known or unknown vulnerabilities and defining and
implementing a road map/plan to mitigate them

Backing up and restoring data is one of the most important responsibilities of IT


professionals

Following are the main types of backups:


o Normal or Full Backups: When a normal or full backup runs on a selected drive, all the
files on that drive are backed up. This, of course, includes system files, application files,
user data — everything. Those files are then copied to the selected destination (backup
tapes, a secondary drive or the cloud), and all the archive bits are then cleared.
o Incremental Backups: A common way to deal with the long running times required for
full backups is to run them only on weekends. Many businesses then run incremental
backups throughout the week since they take far less time. An incremental backup will
grab only the files that have been updated since the last normal backup. Once the
incremental backup has run, that file will not be backed up again unless it changes or
during the next full backup.
o Differential Backups: An alternative to incremental database backups that has a less
complicated restore process is a differential backup. Differential backups and recovery
are similar to incremental in that these backups grab only files that have been updated
since the last normal backup. However, differential backups do not clear the archive bit.

204
So a file that is updated after a normal backup will be archived every time a differential
backup is run until the next normal backup runs and clears the archive bit.

Read: Database backup:


https://www.solarwindsmsp.com/content/types-of-database-backups

Watch: How to backup database using MySQL: https://youtu.be/mr8Lpkx5yag

Database design Methodology


Designing of database is most important responsibility of the software professionals who are
dealing with the database related projects. For this they follow the Design Methodology. It
helps the designer to plan, manage, control, and evaluate database development projects.

Design methodology: A structured approach that uses procedures, techniques, tools, and
documentation aids to support and facilitate the process of design. A design methodology
consists of phases each containing a number of steps, which guide the designer in the
techniques appropriate at each stage of the project.

Phases of Design Methodology


The database design methodology is divided into three main phases. These are:
om

• Conceptual database design


t.c

• Logical database design


ve
syt
ea

Conceptual database design: The process of constructing a model of the information used
in an enterprise, independent of all physical considerations. The conceptual database design
phase begins with the creation of a conceptual data model of the enterprise, which is entirely
independent of implementation details such as the target DBMS, application programs,
programming languages, hardware platform, performance issues, or any other physical
considerations.

Logical database design: It is a process of constructing a model of the information used in


an enterprise based on specific data model, but independent of a particular DBMS and other
physical considerations. The logical database design phase maps the conceptual model on to a
logical model, which is influenced by the data model for the target database (for example, the
relational model). The logical data model is a source of information for the physical design
phase. The output of this process is a global logical data model consisting of an Entity-
Relationship diagram, relational schema, and supporting documentation that describes this
model, such as a data dictionary. Together, these represent the sources of information for the
physical design process, and they provide the physical database designer with a vehicle for
making tradeoffs that are so important to an efficient database design.

205
Physical database design
It is a description of the implementation of the database on secondary storage; it describes the
base relations, file organizations, and indexes used to achieve efficient access to the data, and
any associated integrity constraints and security measures.

Whereas logical database design is concerned with the what, physical database design is
concerned with the how. The physical database design phase allows the designer to make
decisions on how the database is to be implemented. Therefore, physical design is tailored to
a specific DBMS. There is feedback between physical and logical design, because decisions
taken during physical design for improving performance may affect the logical data model.

For example, decisions taken during physical for improving performance, such as merging
relations together, might affect the structure of the logical data model, which will have an
associated effect on the application design.

Steps of physical database design methodology


After designing logical database model, the steps of physical database design methodology
are as follows:
Step 1: Translate global logical data model for target DBMS It includes operations like the
Design of base relation, derived data and design of enterprise constraints.
om

Step 2: Design physical representation: It includes operations like analyzing of transactions,


t.c

selection of file organizations, selection of indexes and estimates the disk space requirements.
ve
yt

Step 2 is most important part in designing of physical design of database. It is used to


s
ea

determine the optimal file organizations to store the base relations and the indexes· that are
required to achieve acceptable performance, that is, the way in which relations and tuples will
be held on secondary storage.

One of the main objectives of physical database design is to store data in an efficient ay.
There are a number of factors that we may use to measure efficiency:
• Transaction throughput
This is the number of transactions that can be processed in a given time interval.
In some systems, such as airline reservations, high transaction throughput is critical to the
overall success of the system.
• Disk storage
This is the amount of disk space required to store the database files. The designer may wish
to minimize the amount of disk storage used.

9.3.8.3 Self-Assessment
i. What are types of backup?
ii. What is database security?
A. Data encryption
B. A view
C. Fingerprint
D. All of the above

206
iii. Data security threats include
A. Privacy invasion
B. Hardware protection
C. Fraudulent manipulation od data
D. All of the above
iv. _______ is responsible for using that the database remains in a consistent state despite
system failure.
A. Storage Manager
B. Transaction manager
C. End user
D. Sophisticated
v. Prevention of access to the database by unauthorized users is referred to as:
A. Integrity
B. Productivity
C. Security
D. Reliability
vi. How will you know your database is unsecure and which software will you use to
make it secure

9.3.8.4 Tools, Equipment, Supplies and Materials


om

PostgreSQL database backup tools, MS SQL database backup solutions


t.c
ve
yt

9.3.8.5 References
s
ea

• https://www.solarwindsmsp.com/content/types-of-database-backups
• Database Systems: Design, Implementation, & Management 12th Edition authored by
Steven Morris, Carlos Coronel, published by Cengage Learning; 2016

207

You might also like