Professional Documents
Culture Documents
1
Chapter 1, Part 3: Database and Database Management Systems
2
Module 1: e-Learning
Learning Objectives
To gain understanding of Data Base Management Systems
To understand Database Models
To understand Database Languages
To gain understanding of People involved with DBMS
To understand Controls features in Database Management Systems
To understand how to audit DBMS
3.1 Introduction
Every organisation has to manage its information i.e. any organisation should know what it needs in
terms of information, acquire that information, organize that information in a meaningful way, assure
information quality and provide software tools so that users in the organisation can access information
they require. To achieve the above objectives, the organisation has to use Data Base Management
Systems (DBMS)
• The word Data is derived from Latin for “to give”, thus “Data” in really gives facts from which
additional facts can be inferred.
• Information is the data that has been processed within a context into a form to give it
meaning or useful for user
• Knowledge is the information that has been analysed, assimilated.
3
Chapter 1, Part 3: Database and Database Management Systems
Data management includes all aspects of data planning, handling, analysis, documentation and
storage, i.e. development, execution and supervision of plans, policies, programs and practices that
control, protect, deliver and enhance the value of data and information assets. Let us understand the
hierarchy of data base.
High Redundancy- Customer details would be recorded in invoicing file as well as accounting
file.
Limited Data Sharing- Each application would reference its own file.
4
Module 1: e-Learning
Low Data Integrity – Let’s say a customer changes address, data might have been updated in
invoicing file but not accounting file.
High Dependence between Data and Application- If any change in the data structure or format
is made in the data file, a corresponding change has to be made in the application program and
vice-versa.
The problems with file systems led to database approach to data management.
The Database system helps us do various operations on these files such as:
5
Chapter 1, Part 3: Database and Database Management Systems
Invoicing
Application
Database
Database Management
Systems
Accounting
Application
With this Database approach, applications would access a common database through Database
Management Systems.
Advantages of a DBMS
Permitting Data Sharing:
One of the main advantages of a DBMS is that the same information can be made available
to different users.
Controlling Data Redundancy:
In a DBMS duplication of information or redundancy is, if not eliminated, carefully controlled
or reduced i.e. there is no need to repeat the same data over and over again. Minimizing
redundancy can, therefore, significantly reduce the cost of storing information on hard drives
and other storage devices, as also avoid data inconsistency.
6
Module 1: e-Learning
User-friendliness:
DBMS makes the data access and manipulation easier for the user. DBMSs also reduce the
reliance of users on computer experts to meet their data needs.
Improved security:
DBMSs allow multiple users to access the same data resources which could lead to risk to
an organisation if not controlled. Security constraints can be defined i.e. Rules can be built
to control access to sensitive data. Some sources of information need to be protected or
secured and only viewed by select individuals. Through the use of passwords, database
management systems can be used to restrict data access to only those who are authorised.
Achieving program/data independence:
In a DBMS, the data and the programs required to update and maintain those data items are
not coupled. Programs being independent of data files can be modified independently of the
data files, since In a DBMS data does not reside in applications but data bases program and
data are independent of each other.
Faster application development
In the case of deployment of DBMS, as the data in a database is independent of the
applications, the latter can be developed to access the database through application
interface. Thus, Application development becomes fast. If any change in the data structure
or format is made in the data file, a corresponding change need not be required in the
application program and vice versa.
Disadvantages of a DBMS
There are two major downsides to using DBMSs. These are Cost and Threat to data security.
Expensive
o Implementing a DBMS system can be expensive and time-consuming., especially
in large organisations.
o Training requirements alone can be quite costly.
o Other disadvantage could be cost of data conversion from legacy Non-DBMS
solutions, requirement of specific skill sets to manage the DBMS (need for a DBA).
o DBA is required to fine tune the DBMS from time to time with increased volumes
and changing requirements.
Security:
o In the absence of proper safeguards in place, it may be possible for some
unauthorised users to access the database. If one gets access to database then it
could be an all or nothing proposition.
DBMS failure: Single point of failure
o As the whole data may be stored in the DBMS, it becomes a single point of failure
resulting in disruption of services/non-availability of data.
7
Chapter 1, Part 3: Database and Database Management Systems
One typical Hierarchical structure could be your Directory (folders) in Windows OS.
8
Module 1: e-Learning
This model represents the database as a collection of Relations and is governed by these rules:
9
Chapter 1, Part 3: Database and Database Management Systems
• All the entries in any column are of the same type or same domain.
• Each column has a domain, a set of possible values that can appear in that column.
• All the entries in any column are of the same type or same domain.
• A row in the table is called Tuple.
• Ordering of rows and columns is insignificant.
• Duplicate rows are not allowed.
• All data items stored in the columns are atomic in nature, that is, they cannot be split
further without loss of information.
• In many tables, there is a column called the Key Column whose value is unique and
cannot be null.
• Domain constraint: This means that all the values in the column of a table must be from
the same domain. Example: In Income Tax Assessee Database Column of First Name would
have all First names and Date of Birth would have all Date of Births in Date format.
• Entity Constraint: This rule is to ensure and assure that the data values for the primary key
are valid and not null. Example: In Income Tax Assesse Database the primary key would be
PAN Number which is unique and never null.
• Referential Integrity: In a relational data model, associations between tables are defined
by using foreign keys. The referential integrity rule states that if there is a foreign key in one
table, either the foreign key must match the primary key of the other table or else the foreign
key value must be null.
10
Module 1: e-Learning
In the above case SalesPersonID in Sales Order Table is foreign key but is primary Key in Sales
Person Table. This Constraint says that if in Sales Order Table for a transaction, SalesPersonId is
0033 then that value should exist as Primary key in Sales Person Table. There might also be a case
where there is direct order, in such a case SalesPersonID would be Null (in the Sales Order table).
Thus Referential Integrity Constraint would not allow someone to create an order booked by a non-
existent salesman.
“Norma” in Latin means Carpenter Square whose job is to set it at right angle.
Similarly, normalization is used to set the table right. Database normalization is a conceptual
Database design technique which involves process of organizing the fields and tables of a relational
database to minimize redundancy and dependency on non-key elements. Objective is all non-key
items are related on key fields It is the process of Conceptual Database Design achieved through -
identification of relationships among various data items, Grouping data items and establishing
relationships and constraints. Normalization usually involves dividing large tables into smaller and still
11
Chapter 1, Part 3: Database and Database Management Systems
smaller (and less redundant) tables and defining relationships between them in order to improve
storage efficiency, data integrity and scalability. The objective is to have data Tables in such a way
that additions, deletions, and modifications of a field can be made in just one table and then
propagated through the rest of the database using the defined relationships.
• Reduced redundancy.
• More efficient data structure.
• More flexible data structure i.e. we are able to add new rows and data values easily.
• Better understanding of data.
12
Module 1: e-Learning
database is called Schema. The data in a DBMS is described at three levels of abstraction or
schemas:
External Schema
It is the user’s view of the database. This level describes that part of the database that is relevant to
each user.
External level is the one which is closest to the end users. Individual users are given different views
according to the user’s requirement.
Conceptual Schema
This level describes what data is stored in the database and the relationships and constraints among
the data. This level contains the logical structure of the entire database. The conceptual level
represents all entities, their attributes and their relationships.
The conceptual schema in above case would consist of EmployeeID, EmployeeName, DateofBirth,
DateofJoining, Department, Designation, Basic Pay, Leave, TDS, Deduction and relationship
amongst them i.e. incorporates view of community of users HR as well as payroll.
All these data items would be in the form of Normalized small Tables with relationships and
constraints.
Internal Schema
It is the physical representation of database on the computer. This level describes how the data is
physically stored in the database. The internal level is concerned with storage space allocation,
Record descriptions, Records placement, Data Compression and Data Encryption Techniques.
13
Chapter 1, Part 3: Database and Database Management Systems
Logical
Structure Conceptual
Schema
Physical
Storage
Structure
Internal Schema
14
Module 1: e-Learning
Data Definition Language (DDL) is used by the DBA (Database Administrator- explained later) and
by database designers to define both conceptual and internal schemas. DDL does not deal with data.
It is a set of SQL commands used to create, modify and drop database structure. These commands
are not generally used by a common user.
Example: To create schema, SQL statement CREATE Table is used or to Modify Schema ALTER
Table is used. All these statements are used to define Database
In the above example: CREATE table isastudent (StudentID varchar (20), roll_no number (10))
This means that we want to create a table with the name ‘isastudent’ with two columns - StudentID
and roll_no. The name field will have attributes of type of: data: character, Maximum size of 20
characters. Similarly, roll no will be a number type with maximum length of 10.
15
Chapter 1, Part 3: Database and Database Management Systems
To query the databases, the commands used to manipulate the databases are part of Data
Manipulation Language (DML). Typical manipulations include retrieval, insertion, deletion, and
modification of data. DML statements are used to maintain and query a database.
It is the area of SQL that allows changing data within the database i.e. enable users to manipulate
data in existing schemas’ objects.
16
Module 1: e-Learning
Example: SQL statement like AVG (Average) MAX (find Largest Value) are used to query the
database
In the above example: SELECT StudentID, roll_No FROM isastudents WHERE StudentID ="1888“
In the table name isastudents, StudentID and roll_No refer to two fields containing StudentID and Roll
number respectively in the table and we are trying to extract data relating to Student with ID “1888”.
To grant the user Pyare.Lal ability to retrieve information from the isastudents Table, we use GRANT
with SELECT
17
Chapter 1, Part 3: Database and Database Management Systems
Provide a standard definition of terms and data elements that can be referenced by
programmers, database administrators, and users to maintain data integrity
Assist programmers in designing and writing programs
Simplify database modification
3.5.3 Data Administrator and Database Administrator
Data Administrator- Administrative and Policy Functions
Data Base Administrator- Technical Functions
Database administrator (DBA) manages the DBMS for an organisation. As organisation Database
Systems are important and complex, the task of designing and maintaining the Database requires a
skilled Database Administrator who has a thorough knowledge of the business of the organisation, is
well versed in the use of DBMS and who keeps abreast with new emerging technologies and
methodologies. The DBA designs schemas, provides security, restores the system after a failure, and
periodically tunes the database to meet changing user needs.
18
Module 1: e-Learning
Web provides interactive interface (to the clients) to the business information stored in back-end
databases. Databases are the functional muscle of the web. System designers are increasingly using
the Web as the front end to database systems. Ability to produce useful information from the
underlying data is the strength of database applications. These could involve searching, filtering,
dicing, slicing and integrating data which is facilitated by Database Applications.
19
Chapter 1, Part 3: Database and Database Management Systems
These Database Applications these days allow us to link company databases to internet help in
establishing data marts and warehouses, helping in remote access and manipulation of data, use
online processing to increase productivity for any organisation. One prominent example of Database
application could be ERP application SAP. Most retail store Web sites like EBay and Amazon use
database systems to store, update and present data about products for sale. The popular Web-based
"Facebook" application is essentially a database built upon the "MySQL" database system and is an
indication of the increasing usage of database applications as foundations for Web-based
applications. In short, one of the reasons of popularity of internet is the ability to link databases. Today
a large number of corporate databases are accessed over internet through a standard web browser.
Stored Procedures
o Database servers offer developers the ability to create and reuse SQL code through
the use of objects called as Stored Procedures (Group of SQL statements).
o These are available to applications accessing a database system and are actually
stored in database. Stored procedures reduce the long SQL queries to a single line.
Triggers
o These are designed to be automatically ‘fired’ when a specific action/event takes
place within a database. E.g. On execution of code to delete an employee from
Master File, a trigger would be executed (automatically) to scan the Employee
Liability Table to check whether any liability against this employee exists.
20
Module 1: e-Learning
Application programmers
Specialized users
Naive users
This user management is achieved through Authorisation and access control
Normally, a database administrator first uses CREATE USER to create an account, then GRANT to
define its privileges and characteristics. For Example in Oracle, The SYS and SYSTEM accounts
have the database administrator (DBA) role granted to them by default. These are predefined all other
users have to be created. Thus there is a need to create user and assign some authentication
mechanism like a Password.
21
Chapter 1, Part 3: Database and Database Management Systems
Data base Administrator will then grant access rights or privileges to user as shown below.
22
Module 1: e-Learning
Auditing Database
The databases may be Front End or Back end. It is important to audit application controls. Applications
facilitate access by customers, employees, and business partners. Many different applications may
be accessing the same database and be subject to differing sets of controls. It is important to audit
the management of controls and also segregation of duties relating to these applications.
23
Chapter 1, Part 3: Database and Database Management Systems
24
Module 1: e-Learning
This can be accomplished using a database auditing tools. Database Management Systems generally
have integrated data base audit tools. These can be configured for the purpose of continuous audit
of all access to sensitive data by privileged and application users, and generation of relevant reports.
They can also provide information on any changes to data base objects.
Some of the commercial databases auditing tools have additional features to issue alert on abnormal
access requests and database attacks. These solutions generate audit reports that can help in
incident response and forensic investigation through centralised management of different databases
being used by an organisation and provide analytical reports. The audit reports can also be configured
to demonstrate compliance with regulatory requirements
25
Chapter 1, Part 3: Database and Database Management Systems
3.9 Summary
At the very heart of most of management information systems are a database and a database
management system. A database maintains information about various entities and a database
management system (DBMS) is software through which users and application programs interact with
a database. We can very well say that Databases and Database Management Systems form the
foundation of information economy. DBMS is crucial for any organisation and has to be controlled,
monitored and assessed.
26
Module 1: e-Learning
3.10 References
1. C J Date, An Introduction to Database Systems (8th Edition), Addison-Wesley.
2. Raghu Ramakrishnan, Database Management Systems, 3rd Edition, McGraw-Hill
3. http://asktom.oracle.com
4. http://www.java2s.com/Code/SQLServer/CatalogSQLServer.htm
27