CUAP DBMS Notes Unit11

Download as pdf or txt
Download as pdf or txt
You are on page 1of 31

DATABASE MANAGEMENT SYSTEMS

Database and Database Users


Unit: 1 Chapter: 1

1.1 Introduction
Importance: Database systems have become an essential component of life in
modern society, in that many frequently occurring events trigger the accessing of
at least one database: bibliographic library searches, bank transactions,
hotel/airline reservations, grocery store purchases, online (Web) purchases, etc.,
etc.

Traditional vs. more recent applications of databases:

The applications mentioned above are all "traditional" ones for which the use of
rigidly- structured textual and numeric data suffices. Recent advances have led
to the application of database technology to a wider class of data. Examples include
multimedia databases (involving pictures, video clips, and sound messages) and
geographic databases (involving maps, satellite images).

Also, database search techniques are applied by some WWW search engines.

Definitions

Data
• Facts that can be recorded or stored.
• E.g. Person Name, Age, Gender and Weight etc.
Information
• When data is processed, organized, structured or presented in a given
context so as to make it useful, it is called information.
Database
• A Database is a collection of inter-related data.
• E.g. Books Database in Library, Student Database in University etc.
DBMS (Database Management System)
• A database management system is a collection of inter-related data and
set of programs to manipulate those data.
• DBMS = Database + Set of programs
• E.g. MS SQL Server, Oracle, My SQL, SQLite, MongoDB etc.
Metadata
• Metadata is data about data.
• Data such as table name, column name, data type, authorized user and
user access privileges for any table is called metadata for that table.
Data dictionary
• Data dictionary is an information repository which contains metadata.
• It is usually a part of the system catalog.

1
DATABASE MANAGEMENT SYSTEMS

Data warehouse
• Data warehouse is an information repository which stores data.

• It is design to facilitate reporting and analysis.


Field
• A field is a character or group of characters that have a specific meaning.
• It is also called a data item. It is represented in the database by a value.
• For Example customer id, name, society and city are all fields for customer
Data.
Record
• A record is a collection of logically related fields.
• For examples, collection of fields (id, name, address & city) forms a record
for customer.

Data vs. information vs. knowledge: Data is the representation of "facts" or


"observations" whereas information refers to the meaning thereof (according to
some interpretation). Knowledge, on the other hand, refers to the ability to use
information to achieve intended ends.
Computerized vs. manual:
A manual database is a database which is based on paper that is data is written
on paper. For example phone book.
A computerized database means data that we stored in computer in an
organized and structured form and it is more useful in terms of speed and ease.
It can be done by oracle (Database Application).
Size/Complexity: Databases run the range from being small/simple (e.g., one
person's recipe database) to being huge/complex (e.g., Amazon's database that
keeps track of all its products, customers, and suppliers).

Definition: A database management system (DBMS) is a collection of


programs enabling users to create and maintain a database.

More specifically, a DBMS is a general purpose software system facilitating each of


the following (with respect to a database):

• Defining : specifying data types (and other constraints to which the data must
conform) and data organization
• Constructing : the process of storing the data on some medium (e.g.,
magnetic disk) that is controlled by the DBMS
• Manipulating: querying, updating, report generation
• Sharing: allowing multiple users and programs to access the database
"simultaneously"
• System protection: preventing database from becoming corrupted when
hardware or software failures occur
• Security protection: preventing unauthorized or malicious access to database.
• Maintain: DBMS must be able to maintain the database system by allowing
the system to evolve as requirements change over time.

2
DATABASE MANAGEMENT SYSTEMS

• Application program: accesses the database by sending queries or requests


for data to the DBMS.
• Query : typically causes some data to be retrieved;
• Transaction: may cause some data to be read and some data to be written
into the database.

• A database together with the DBMS software is referred to as a


database System

The below figure illustrates some of the concepts which we discussed


here

A Simplified Database System Environment

1.1 : Characteristics of the Database Approach:

Database approach vs. File processing approach:

Consider an organization/enterprise that is organized as a collection of


departments/offices. Each department has certain data processing "needs", many
of which are unique to it. In the file processing approach, each department
would control a collection of relevant data files and software applications to
manipulate that data.
For example, a university's Registrar's Office would maintain data and programs
relevant to student grades and course enrollments. The accounting Office would
maintain data and programs pertaining to fees owed by students for tuition, room and
board, etc. Most likely, the people in these offices would not be in direct possession
of their data and programs, but rather the university's Information Technology
Department would be responsible for providing services such as data storage, report
generation, and programming.
3
DATABASE MANAGEMENT SYSTEMS

Disadvantages of File processing approach or conventional file-based system


compared to Database Management System are as follows

1. Data Redundancy
• It is possible that the same information may be duplicated in different
files. This leads to data redundancy.
• Data redundancy results in memory wastage.
• For example, consider that some customers have both kinds of accounts -
saving and current. In this case, data about customers such as name,
address, e-mail and contact number will be duplicated in both files, saving
accounts file and current account file.
• In other words, same information will be stored in two different locations
(files). And, it wastes memory.
2. Data Inconsistency
• Due to data redundancy, it is possible that data may not be in consistent
state.
• For example, consider that an address of some customer changes. And,
that customer has both kinds of accounts. Now, it is possible that this
changed address is updated in only one file, leaving address in other file
as it is. As a result of this, same customer will have two different addresses
in two different files, making data inconsistent.
3. Difficulty in Accessing Data
• Accessing data is not convenient and efficient in file processing system.
• For example, suppose, there is a program to find information about all
customers. But, what if there is a need to find out all customers from
some particular city. In this case, there are two choices here: One, find out
all customers using available program, and then extract the needed
customers manually. Second, develop new program to get required
information. Both options are not satisfactory.
• For each and every different kind of data access, separate programs are
required. This is neither convenient nor efficient.
4. Limited Data Sharing
• Data are scattered in various files.
• Different files may have different formats. And these files may be stored in
different folders (directories) may be of different computers of different
departments.
• So, due to this data isolation, it is difficult to share data among different
applications.
5. Integrity Problems
• Data integrity means that the data contained in the database is both
correct and consistent. For this purpose, the data stored in database must
satisfy certain types of constraints (rules).

4
DATABASE MANAGEMENT SYSTEMS

• For example, a balance for any account must not be less than zero. Such
constraints are enforced in the system by adding appropriate code in
application programs. But, when new constraints are added, such as
balance should not be less than Rs. 5000, application programs need to
be changed. But, it is not an easy task to change programs whenever
required.
6. Atomicity Problems
• Any operation on database must be atomic. This means, operation
completes either 100% or 0%.
• For example, a fund transfer from one account to another must happen in
it’s entirely. But, computer systems are vulnerable to failure, such as
system crash, virus attack. If a system failure occurs during the execution
of fund transfer operation, it may possible that amount to be transferred,
say, Rs. 500, is debited from one account, but is not credited to another account.
• This leaves database in consistent state. But, it is difficult to ensure
atomicity in a file processing system.
7. Concurrent Access Anomalies
• Multiple users are allowed to access data simultaneously (concurrently).
This is for the sake of better performance and faster response.
• Consider an operation to debit (withdrawal) an account. The program
reads the old balance, calculates the new balance, and writes new balance
back to database. Suppose an account has a balance of Rs. 5000. Now, a
concurrent withdrawal of Rs. 1000 and Rs. 2000 may leave the balance Rs.
4000 or Rs. 3000 depending upon their completion time rather than the
correct value of Rs. 2000.
• Here, concurrent data access should be allowed under some supervision.
• But, due to lack of co-ordination among different application programs,
this is not possible in file processing systems.
8. Security Problems
• Database should be accessible to users in a limited way.
• Each user should be allowed to access data concerning his application only.
• For example, a customer can check balance only for his/her own account.
He/ She should not have access for information about other accounts.
• But, in file processing system, application programs are added in an ad
hoc manner by different programmers. So, it is difficult to enforce such
kind of security constraints.

In the database approach, a single repository of data is maintained that is used


by all the departments in the organization

5
DATABASE MANAGEMENT SYSTEMS

Main Characteristics of database approach:

1. Self-Description: A database system includes —in addition to the data stored, a


complete definition/description of the database's structure and constraints. This meta-data
i.e., data about data is stored in system catalog, which contains a description of the
structure of each file, the type and storage format of each field, and the various
constraints on the data (i.e., conditions that the data must satisfy).
The Program-Data Independence: In traditional file processing, the structure of data
files is embedded in the application programs, so any changes to the structure of a
file may require changing all programs that access that file. By contrast, DBMS access
programs do not require such changes in most cases. The structure of data files is
stored in the DBMS catalog separately from the access programs. This property is
called as program-data independence.

If we want to add another piece of data to each STUDENT record, say the Birth_date,
such a program will no longer work and must be changed. By contrast, in a DBMS
environment, we only need to change the description of STUDENT records in the
catalog to reflect the inclusion of the new data item Birth_date; no programs are
changed.

System catalog is used not only by users (e.g., who need to know the names of tables
and attributes, and sometimes data type information and other things), but also by the
DBMS software, which certainly needs to "know" how the data is structured/organized in
order to interpret it in a manner consistent with that structure.

2. Insulation between Programs and Data; Data Abstraction:


Data
Abstraction:
◼ Data Abstraction refers to act of representing essential details
without including background details. For example consider user
needs to know student details such as marks obtained are stored
in the database, not how they are stored in the database.

◼ A data model is used to hide storage details and present the


users with a conceptual view of the database.
◼ Programs refer to the data model constructs rather than data storage

6
DATABASE MANAGEMENT SYSTEMS

details

3. Multiple Views of Data: A database typically has many types of users, each of
whom may require a different perspective or view of the database.
A view may be a subset of the database or it may contain virtual data that is derived
from the database files but is not explicitly stored. Some users may not need to be
aware of whether the data they refer to is stored or derived.
A multiuser DBMS whose users have a variety of distinct applications must provide
facilities for defining multiple views. For example, one user of the database may be
interested only in accessing and printing the transcript of each student; the view for
this user is shown in Figure 1.5(a). A second user, who is interested only in checking
that students have taken all the prerequisites of each course for which the student
registers, may require the view shown in Figure 1.5(b).

4. Data Sharing and Multi-User Transaction Processing: the simultaneous access of


computer resources by multiple users/processes is a major source of complexity.

Concurrency control, which is supposed to ensure that several users trying to update
the same data do so in a "controlled" manner so that the results of the updates are
as though they were done in some sequential order (rather than interleaved, which
could result in data being incorrect).

This gives rise to the concept of a transaction, which is a process that makes one or
more accesses to a database and which must have the appearance of executing in
isolation from all other transactions (even ones that access the same data at the
"same time") and of being atomic (in the sense that, if the system crashes in the
middle of its execution, the database contents must be as though it did not
execute at all).

Applications such as airline reservation systems are known as online


transaction processing applications.
7
DATABASE MANAGEMENT SYSTEMS

1.4 Actors on the Scene:

These apply to "large" databases, not "personal" databases that are defined,
constructed, and used by a single person via, say, Microsoft Access.
Users may be divided into
◼ Those who actually use and control the database content, and those
who design, develop and maintain database applications (called
“Actors on the Scene”), and
◼ Those who design and develop the DBMS software and related
tools, and the computer systems operators (called “Workers
Behind the Scene”).

1 Database Administrator (DBA): A DBA is a chief administrator


to oversee and manage these resources. Administering
database, DBMS and related software is the responsibility of the
DBA. The DBA is responsible for authorizing access to the
database, coordinating and monitoring its use and acquiring
hardware and software resources as needed. In large
organizations, the DBA is assisted by a staff that carries out
these functions.
2 Database Designers: They are responsible for identifying the data to
be stored in the database and for choosing an appropriate way to
organize it. They also define views for different categories of
users. The final design must be able to support the requirements of
all the user sub-groups.
3 End Users: These are persons who access the database for
querying, updating, and generating reports. The database
primarily exists for their use. There are several categories of users
o Casual end users: use database occasionally, but they may need
different information each time; use sophisticated query interface to
specify their requests; typically middle- or high-level managers.
o Naive/Parametric end users: Typically the biggest group of users;
frequently query/update the database using standard types of queries
and updates called canned transactions that have been carefully
programmed and tested in advance. Examples:
▪ Bank tellers check account balances, post
withdrawals/deposits
▪ Reservation clerks and customers for airlines, hotels, etc
check availability of seats/rooms
and make reservations.
▪ Shipping clerks (e.g., at UPS) who use buttons, bar code
scanners, etc., to update status of in-transit packages.
o Sophisticated end users: include engineers, scientists, business
analysts who implement their own applications to meet their
complex needs.
o Stand-alone users: These are the users who maintain their personal
database using readymade software which is available in the market
easily and provide the menu based interface through which they can
easily used the database..
8
DATABASE MANAGEMENT SYSTEMS

▪An example is a tax program user that creates its own internal
database.
▪ Another example is maintaining an address book
4 System Analysts, Application Programmers, Software Engineers:
o System Analysts: determine requirements of end users, especially
naive and parametric users, and develop specifications for canned
transactions that meet these requirements.
o Application Programmers: Implement, test, document, and
maintain programs that satisfy the specifications mentioned above.
o Such analysts and application programmers commonly referred to as
software developers or software engineers

1.5 : Workers behind the Scene

• DBMS system designers/implementers: design and implement


the DBMS modules and interfaces as software. A DBMS is complex
software that consists of many components or modules for
implementing the catalog, query language processing, interface
processing, accessing, buffering data and controlling concurrency
and handling data recovery and security.
• Tool developers: design and implements software tools
facilitating database system design, performance monitoring,
creation of graphical user interfaces, prototyping, etc.
• Operators and maintenance personnel: responsible for the day-to-
day operation of the system.

1.6 : Capabilities/Advantages of DBMS's

1. Program data independence:

If a database approach is used, data is stored in a central location called


repository. The process of database allows an enterprise’s data to change the
database without modifying the application programs which are able to
process this data. This allows the separation of database from application
programs.

2. Controlling Redundancy:
Data redundancy is a problem that causes storing of redundant amount
of data. Redundancy means unnecessary duplication of data.
This redundancy in storing the same data multiple times leads to several
problems.
➢ There is the need to perform a single logical update- such as
entering data on a new student multiple times, once for each file
where student data is recorded. This leads to duplication of
effort.
➢ Second, storage space is wasted when same data is stored
repeatedly, and this problem may be serious for large databases.

9
DATABASE MANAGEMENT SYSTEMS

➢ Third, files that represent the same data may become inconsistent.
This may happen because an update is applied to some of the files
but not to others
➢ For example, employee mobile number is stored in employee
personal data, employee department data, employee salary data, etc.
if you need to change the mobile number of a particular employee,
then you have to change in three locations .If you miss any one
location/copy then we are not sure about the mobile number.
➢ So data redundancy causes inconsistencies. When data redundancy
is controlled data anomalies and inconsistencies are eliminated.
3. Improved data consistency:
If the amount of data redundancy is controlled, it will reduce data
inconsistency also. It is also highly recommended to maintain the same version
of data at all the locations. For example, when a customer address is stored at
only one location, if the customer changes the address, it will be automatically
reflected in all the applications related to that particular customer.
4. Restricting Unauthorized Access: When multiple users share a large
database, it is likely that most users will not be authorized to access all
information in the database. For example, financial data such as salaries and
bonuses is often considered confidential and only authorized persons are
allowed to access such data. In addition, some users may only be permitted
to retrieve data, whereas others are allowed to retrieve and update.
A DBMS should provide a security and authorization subsystem, which is
used for specifying these restrictions on user accounts.
5. Enforcements of Standards:
To facilitate the services of database management, every DBA designs
establishing procedures and enforcement of standards. Procedures are the
instructions and rules that govern the design and use of the database
system. Procedures are also used to ensure that there is an organized way
to monitor and audit both the data and the information that is generated
through the use of the data.
6. Providing Persistent Storage for Program Objects: Object-oriented
database systems make it easier for complex runtime objects (e.g., lists,
trees) to be saved in secondary storage so as to survive beyond program
termination and to be retrievable at a later time.
7. Providing Storage Structures for Efficient Query Processing: The DBMS
maintains indexes (typically in the form of trees and/or hash tables) that are
utilized to improve the execution time of queries and updates
8. The query processing and optimization module is responsible for choosing
an efficient query execution plan for each query submitted to the system.
9. Providing Backup and Recovery: The subsystem having this responsibility
ensures that recovery is possible in the case of a system crash during
execution of one or more transactions.
10. Providing Multiple User Interfaces: For example, query languages for

10
DATABASE MANAGEMENT SYSTEMS
casual users, programming language interfaces for application programmers, forms

11
DATABASE MANAGEMENT SYSTEMS

and/or command codes for parametric users, menu-driven interfaces for stand-
alone users.
11. Representing Complex Relationships Among Data: A DBMS should
have the capability to represent such relationships and to retrieve related
data quickly.

Disadvantages of DBMS
1. It is bit complex. Since it supports multiple functionality to give the user
the best, the underlying software has become complex. The designers and
developers should have thorough knowledge about the software to get
the most out of it.
2. Because of its complexity and functionality, it uses large amount of
memory. It also needs large memory to run efficiently.
3. DBMS system works on the centralized system, i.e.; all the users from all
over the world access this database. Hence any failure of the DBMS, will
impact all the users.
4. DBMS is generalized software, i.e.; it is written work on the entire systems
rather specific one. Hence some of the application will run slow.

1.7 : A Brief History of Database Applications

Early Database Applications:


◼ The Hierarchical and Network Models were introduced in mid
1960s and dominated during the seventies.
◼ A bulk of the worldwide database processing still occurs using these
models.
Relational Model based Systems:
◼ Relational model was originally introduced in 1970, was heavily
researched and experimented with in IBM Research and several
universities.
Object-oriented and emerging applications:
◼ Object-Oriented Database Management Systems (OODBMSs) were
introduced in late 1980s and early 1990s to cater to the need of complex
data processing in CAD and other applications.

◼ Their use has not taken off much.

Many relational DBMSs have incorporated object database concepts, leading to a new
category called object-relational DBMSs (ORDBMSs)

Extended relational systems add further capabilities (e.g. for multimedia data, XML, and
other data types)
◼ Relational DBMS Products emerged in the 1980s
◼ Data on the Web and E-commerce Applications:
◼ Web contains data in HTML (Hypertext markup language) with
links among pages.
◼ This has given rise to a new set of applications and E-commerce is

12
DATABASE MANAGEMENT SYSTEMS

using new standards like XML (eXtended Markup Language).


◼ Script programming languages such as PHP and JavaScript allow
generation of dynamic Web pages that are partially generated
from a database
◼ New functionality is being added to DBMSs in the following
areas:
◼ Scientific Applications
◼ XML (eXtensible Markup Language)
◼ Image Storage and Management
◼ Audio and Video data management
◼ Data Warehousing and Data Mining
◼ Spatial data management
◼ Time Series and Historical Data Management
◼ The above gives rise to new research and development in
incorporating new data types, complex data structures, new
operations and storage and indexing schemes in database
systems.
◼ Also allow database updates through Web pages

1.8 : When Not to Use a DBMS:


There are a few situations in which a DBMS may involve unnecessary overhead
costs that would not be incurred in traditional file processing. The overhead costs of
using a DBMS are due to the following:

◼ High initial investment and possible need for additional hardware.


◼ The generality that a DBMS provides for defining and processing
data.
◼ Overhead for providing generality, security, concurrency control,
recovery, and integrity functions.
It may be more desirable to develop customized database applications
under the following circumstances:
◼ If the database and applications are simple, well defined, and not
expected to change.
◼ If there are stringent real-time requirements that may not be met
because of DBMS overhead.
◼ If access to data by multiple users is not required.
◼ When no DBMS may suffice:
◼ If the database system is not able to handle the complexity of
data because of modeling limitations
◼ If the database users need special operations not supported by the
DBMS.

13
DATABASE MANAGEMENT SYSTEMS

Database System Concepts and Architecture


Unit: 1 Chapter: 2

Data Models, Schemas, and Instances

One fundamental characteristic of the database approach is that it provides some level
of data abstraction by hiding details of data organization and storage that are
irrelevant to database users and highlighting the essential features for an improved
understanding of data.

A data model is a collection of concepts that can be used to describe the


conceptual/logical structure of a database. It provides the necessary means to
achieve this abstraction.

Structure of database means the data types, relationships, and constraints that apply
to the data. Most data models also include a set of basic operations for specifying
retrievals/updates.

In addition to the basic operations provided by the data model, it is required to


include concepts in the data model to specify the behaviour (valid user
defined functions) of a database application.

An example of a user-defined operation could be COMPUTE_GPA, which can be


applied to a STUDENT object. On the other hand, generic operations to insert,
delete, modify, or retrieve any kind of object are often included in the basic data
model operations. Concepts to specify behaviour are fundamental to object-
oriented data models

In the relational data model, data is viewed as being organized in two-


dimensional tables comprised of tuples of attribute values. This model has operations
such as Project, Select, and Join.

There are other well-known data models that have been the basis for database systems.
The best- known models pre-dating the relational model are the hierarchical (in
which the entity types form a tree) and the network (in which the entity types and
relationships between them form a graph).

Categories of Data Models (based on degree of abstractness):

1. High-level/conceptual data model: provides a view close to the way


users would perceive data. This model uses concepts such as
o Entity: an entity represents a real-world object orconcept such as
student, employee, course, department, and event.
o Attribute: An attribute represents characteristics or properties of an
entity. Example: student id, student name, employee name,
designation etc.
14
DATABASE MANAGEMENT SYSTEMS

o Relationship: An association among entities is called as a


relationship.
Example: A Student Enrolls in a Course. Here “Student” and
“Course” are two different entities and the relationship between
them is “Enrolls”
2. Representational/ implementation: Representational
data model provides concepts that may be easily
understood by end users. These models hide many
details of data storage on disk but can be
implemented on a computer directly. These models
are used most frequently in commercial DBMSs.
Examples include relational data model or the network model. Also called
record-based model.
3. Low - level/physical: gives details as to how data is stored in computer
system, such as record formats, orderings of records, access paths
(indexes).
What is a data model? Explain different types of data models?
Data Model:
A data model is a collection of concepts that can be used to describe the
conceptual/logical structure of a database. The structure of a database means
that holds the data’s data types, relationships, and constraints.
Importance of Data Models:
Data models can facilitate the interaction among the designer, the
application programmer and the end user.
Data model can be called as a communication tool.
The most common data models are:
1. Hierarchical data model
2. Network data model
3. ER data model
4. Relational data model
5. Object oriented data model

1. Hierarchical Data Model:


This model was developed in 1960’s to manage large amounts of data for
complex manufacturing projects. The hierarchical model contains levels or
segments which is equivalent to the file system’s record type. The
hierarchical model depicts as set of one-to-many (1: M) relationships
between a parent and its children segments.
➢ In this model, a child node will only have a single parent node.
➢ This model efficiently describes many real-world relationships like index
of a book, recipes etc.
In hierarchical model, data is organised into tree-like structure with one one-to-many
relationship between two different types of data, for example, one department can
have many courses, many professors and of-course many students.

15
DATABASE MANAGEMENT SYSTEMS

• Advantages :
▪ It promotes Data Sharing.
▪ Parent / Child relationship promotes conceptual simplicity and data
integrity.
▪ Database security is provided and enforced by DBMS.
• Disadvantages:
▪ Complex implementation requires knowledge of physical data storage
characteristics.
▪ Changes in structure require changes in all application programs.
▪ There is no data definition or data manipulation language in the
DBMS.
▪ There is a lack of standards.
2. Network Data Model:
In this model, the user observes the network database as a collection of
records in 1: M relationship. This model allows a record to have more than
one parent.
In network database terminology, a relationship is called as a set which is
composed of at least two record types, an ―owner record and a ―member
record.
A set represents a 1: M relationship between owner and the member.

➢ Advantages:
▪ It handles more relationship types such as M:N and multi parent.
▪ Data access is more flexible than in hierarchical and file system models.
▪ Data Owner/Member relationship promotes data integrity.

16
DATABASE MANAGEMENT SYSTEMS

▪ It includes data definition language (DDL) and data manipulation language


(DML) in DBMS.
➢ Disadvantages:
▪ Navigation System yields complex implementation, application
development and management.
▪ Structural changes require changes in all application programs.
3. Relational Model
➢ It was introduced in 1970 by E.F. Codd.
➢ A relation is a matrix composed of intersecting rows and columns. Each row
in a relation is called a tuple or instance and each column is called an
attribute.
➢ This model is implemented through a very sophisticated relational
database management system (RDBMS).
➢ The relational model provides a minimum level of controlled redundancy
to eliminate most of the redundancies commonly found in file system.

➢ Advantages:
▪ Structural independence is promoted by the use of independent
tables.
▪ Ad hoc query capability is based on SQL.
▪ Powerful RDBMS isolates the end user from the physical level details.
➢ Disadvantages:
▪ The RDBMS requires substantial hardware and system software
overhead.
▪ Conceptual simplicity gives relatively untrained people the tools to
use a good system.

4. Object Oriented Data Model


▪ In object oriented data model both data and their relationships are
contained in a single structure known as an Object. It is the basis for
the object oriented database management system (OODBMS).
▪ In OODM, an object also contains all operations that can be
performed on it such as changing data value, printing data value etc.

17
DATABASE MANAGEMENT SYSTEMS

▪ Object oriented data models are typically depicted using Unified


Modelling Language (UML)

➢ Advantages:
▪ Semantic content is added.
▪ Visual representation includes semantic
content.
▪ Inheritance promotes data integrity
➢ Disadvantages:
▪ Slow development of standards caused vendors
to supply their own enhancements, thus
eliminating a widely accepted standard.
▪ It is a complex navigational system.
▪ High system overhead slows transactions.
5. Entity-relationship (E-R) data model:
▪ The ER data model is based on a perception of a real world that
consists of a collection of basic objects, called entities, and of
relationships among these objects.
➢ Entity: A real world object
E.g. customers, accounts, bank branch
➢ Relationship: An association between entities.
E.g. Pursues, works-for, managers
➢ Attribute: Property of the Entity.
E.g. empno, ename, sal.

Database design in E-R model usually converted to design in the relational


model, which is used for storage, and processing. The overall logical structure
(schema) of a database can be expressed graphically by an E-R diagram, which is
built up from the following components:
➢ Rectangles, which represent entity sets.
➢ Ellipses, which represent attributes.
➢ Diamonds, which represent relationships among entity sets
➢ Lines, which link attributes to entity sets and entity sets to relationships
➢ Each component is labelled with the entity or relationship that it represents.

➢ Advantages :
▪ Conceptual simplicity: ER model represents the concepts of a
database along with its entities and relationships in an easy way. It

18
DATABASE MANAGEMENT SYSTEMS

becomes easier to create and manage the complex database designs


by using ER model
▪ Easy conversion for ER to other data model: Conversion from E-R
diagram to a network or hierarchical data model can· easily be
accomplished.
▪ Graphical representation for better understanding: An E-R model
gives graphical and diagrammatical representation of various entities,
its attributes and relationships between entities. This is turn helps in
the clear understanding of the data structure and in minimizing
redundancy and other problems.

➢ Disadvantages of E-R Data Model


▪ There is no industry standard notation for developing an E-R diagram.
▪ The E-R data model is especially popular for high level.
▪ The E-R model represents limited relationships among the entities.

Explain Schemas, Instances, and Database State?

Database schema: the description of the database is called as database


schema, which is specifiedduring design andis not expected to change frequently.

Schema Diagram: A displayed schema in the form of a diagram is called as


schema diagram.

The sample schema diagram of a Student and Course database.

Schema diagram displays the structure of each record type but not the actual
instances of records.

Database state or snapshot: The actual data stored in the database probably
changes often. The data in the database at a particular time is called the database
state, or a snapshot. It is also called the current set of occurrences or instances
in the database.

For example: STUDENT construct will contain the set of individual entities
(records) as its instances.

Note: The schema is sometimes called the intension, and the database state is
called an extension of the schema.

19
DATABASE MANAGEMENT SYSTEMS

Application requirements change occasionally, which is one of the reasons why


software maintenance is important. On such occasions, a change to a database's
schema may be called for.

An example would be to add a Date_of_Birth field/attribute to the STUDENT table.

Making changes to a database schema is known as schema evolution. Most


modern DBMS’s support schema evolution operations that can be applied while
a database is operational.

Explain Three-Schema Architecture or ANSI/SPARC Data Model?

A commonly used view of data approach is the three-level architecture suggested by the
ANSI/SPARC (American National Standards Institute/Standards Planning and
Requirements Committee). ANSI/SPARC proposed an architectural framework for
databases.

The three levels of the architecture are three different views of the data:
• External schema or view level
• Conceptual schema or logical schema
• Physical schema or internal schema

Three schema architecture diagram:

Three level database architecture allows a clear separation of the information


meaning (conceptual view) from the external data representation and from the
physical data structure layout. A database system that is able to separate the three
different views of data is likely to be flexible and adaptable.

Physical Schema /Internal Schema:


• This is the lowest level of the data abstraction.
• It describes how the data are actually stored on storage devices.
• It is also known as a physical level.
• The internal view is described by internal schema.
• Internal schema consists of definition of stored record, method of
representing the data field and access method used.

20
DATABASE MANAGEMENT SYSTEMS

Conceptual Level
• This is the next higher level of the data abstraction.
• It describes what data are stored in the database and what
relationships exist among those data.
• It is also known as a logical level.
• Conceptual view is defined by conceptual schema. It describes all
records and relationship.
External Level
• This is the highest level of data abstraction.
• It is also known as view level.
• It describes only part of the entire database that a particular end user
requires.
• External view is describes by external schema.
• External schema consists of definition of logical records, relationship
in the external view and method of deriving the objects from the
conceptual view.
• This object includes entities, attributes and relationship.

Mapping and Its Types:


Mapping:
• The process of transforming requests and results between the three
levels is called mapping.
Types of Mapping:
• Conceptual/Internal Mapping
• External/Conceptual Mapping
Conceptual/Internal Mapping:
• It relates conceptual schema with internal schema.
• It defines correspondence between the conceptual schema and the
database stored in physical devices.
• It specifies how conceptual records and fields are presented at the internal
level.
• If the structure of stored database is changed, then
conceptual/internal mapping must be changed accordingly and
conceptual schema can remain invariant.
• There could be one mapping between conceptual and internal levels.
• Provides physical data independence.
External/Conceptual Mapping
• It relates each external schema with conceptual schema.
• It defines correspondence between a particular external view and
conceptual schema.
• If the structure of conceptual schema is changed, then
external/conceptual mapping must be changed accordingly and

21
DATABASE MANAGEMENT SYSTEMS

external schema can remain invariant.


• There could be several mappings between external and conceptual levels.
• Provides logical data independence.
Explain Data Independence?
Data Independence
• Data independency is the ability to modify a schema definition in one
level without affecting a schema definition in the next higher level.
Types of data independence
• Physical data independence
• Logical data independence

Physical data independence


• Physical data independence allows changing in physical storage
devices or organization of file without changing the conceptual view
or external view.
• Modifications at the internal level are occasionally necessary to improve
performance.
• Physical data independence separates conceptual level from the internal
level.
• It is easy to achieve physical data independence.
Logical data independence
• Logical data independence is the ability to modify the conceptual
schema without requiring any change in application programs.
• Conceptual schema can be changed without affecting the existing external
schema.
• Modifications at the logical level are necessary whenever the logical
structure of the database is altered.
• Logical data independence separates external level from the conceptual
view.
• It is difficult to achieve logical data independence.

The process of transforming data via mappings can be costly (performance- wise),
whichis probably onereasonthatreal-life DBMS's don't fully implement this 3-schema
architecture.

Database Languages and Interfaces:

Database Languages:

A database system provides a data definition language to specify the database


schema and a data manipulation language to express database queries and
updates. In practice, the data definition and data manipulation languages are not
two separate languages; instead they simply form parts of a single database

22
DATABASE MANAGEMENT SYSTEMS

language, such as the widely used SQL language.

Data-Definition Language:

We specify a database schema by a set of definitions expressed by a special


language called a data-definition language (DDL).

For instance, the following statement in the SQL language defines the account
table:

Create table account (account_number char(10), balance number(10,2));

Execution of the above DDL statement creates the account table. In addition, it
updates a special set of tables called the data dictionary or data directory.

We specify the storage structure and access methods used by the database system
by a set of statements in a special type of DDL called a data storage and
definition language or storage definition language. These statements define
the implementation details of the database schemas, which are usually hidden
from the users.

The data values stored in the database must satisfy certain consistency constraints.
For example, suppose the balance on an account should not fall below Rs. 1000.
The DDL provides facilities to specify such constraints. The database systems check
these constraints every time the database is updated.
Data-Manipulation Language:

Data manipulation is
• The retrieval of information stored in the database.
• The insertion of new information into the database.
• The deletion of information from the database.
• The modification of information stored in the database

A data-manipulation language (DML) is a language that enables users to


access or manipulate data as organized by the appropriate data model.
There is basically two types:

Procedural DMLs or low level DMLs: require a user to specify what data are
needed and how to get those data.

Declarative DMLs (also referred to as nonprocedural DMLs): require a user to


specify what data are needed without specifying how to get those data.
Declarative DMLs are usually easier to learn and use than are procedural DMLs.
However, since a user does not have to specify how to get the data, the database
system has to figure out an efficient means of accessing data. The DML
23
DATABASE MANAGEMENT SYSTEMS

component of the SQL language is nonprocedural.


A query is a statement requesting the retrieval of information. The portion of a DML
that involves information retrieval is called a query language

This query in the SQL language finds the name of the customer whose
customer-id is 192:
Select customer_name from customer where customer_id = 192;

The query specifies that those rows from the table customer where the
customer_id is 192 must be retrieved, and the customer_name attribute of
these rows must be displayed.

DBMS interfaces:
A database management system (DBMS) interface is a user interface which allows the
ability to input queries to a database without using the query language itself.
User-friendly interfaces provide by DBMS may include the following:
1. Menu-Based Interfaces for Web Clients or Browsing –
These interfaces present the user with lists of options called menus that lead the
user through the formation of a request. Pull-down menus are a very popular
technique in Web based interfaces.
2. Apps for Mobile Devices:
These interfaces present mobile users with access to their data.
For example, banking, reservations, and insurance companies, among many
others, provide apps that allow users to access their data through a mobile
phone or mobile device. The apps have built-in programmed interfaces that
typically allow users to login using their account name and password; the apps
then provide a limited menu of options for mobile access to the user data, as
well as options such as paying bills (for banks) or making reservations (for
reservation Web sites).
3. Forms-based Interfaces:
A forms-based interface displays a form to each user. Users can fill out all of the
form entries to insert new data, or they can fill out only certain entries, in which
case the DBMS will retrieve matching data for the remaining entries. Forms are
usually designed and programmed for naive users as interfaces to canned
transactions.
Example: SQL*Forms, Oracle Forms
- Provides an extensive set of features to design and build applications using
forms.
- Some systems have utilities that define a form by letting the end user
interactively construct a sample form on the screen.

24
DATABASE MANAGEMENT SYSTEMS

4. Graphical User Interfaces: A GUI typically displays a schema to the user in


diagrammatic form. The user then can specify a query by manipulating the
diagram. In many cases, GUIs utilize both menus and forms.
5. Natural Language Interfaces:
These interfaces accept requests written in English or some other language and
attempt to understand them. A natural language interface usually has its own
schema, which is similar to the database conceptual schema, as well as a
dictionary of important words.
6. Keyword-based Database Search:
These are somewhat similar to Web search engines, which accept strings of
natural language (like English or Spanish) words and match them with documents
at specific sites or Web pages on the Web at large (for engines like Google or
Ask). They use predefined indexes on words and use ranking functions to retrieve
and present resulting documents in a decreasing degree of match. Keyword-
based querying has emerged recently for relational databases.
7. Speech Input and Output:
Limited use of speech as an input query and speech as an answer to a question
or result of a request is becoming common place. Applications with limited
vocabularies, such as inquiries for telephone directory, flight arrival/departure,
and credit card account information, are allowing speech for input and output to
enable customers to access this information. The speech input is detected using a
library of predefined words and used to set up the parameters that are supplied
to the queries. For output, a similar conversion from text or numbers into speech
takes place.
8. Interfaces for the DBA:
Most database systems contain privileged commands that can be used only by
the DBA staff. These include commands for creating accounts, setting system
parameters, granting account authorization, changing a schema, and reorganizing
the storage structures of a database.
The Database System Environment:
The term database system refers to an organization of components that define and
regulate the collection, storage, management, and use of data within a database
environment.
From a general management point of view, the database system is composed of the
five major parts shown in below figure: hardware, software, people, procedures, and
data.
• Hardware: Hardware refers to all of the system’s physical devices
for example, computers (PCs, workstations, servers, and supercomputers),
storage devices, printers, network devices (hubs, switches, routers, fiber
optics), and other devices (automated teller machines, ID readers, and so on).

25
DATABASE MANAGEMENT SYSTEMS

• Software: To make the database system function fully, three types of software
are needed: operating system software, DBMS software, and application
programs and utilities.
a. Operating system software manages all hardware components and makes it
possible for all other software to run on the computers.
Examples: Microsoft Windows, Linux, Mac OS, UNIX.
b. DBMS software manages the database within the database system. Some
Examples: Microsoft’s SQL Server, Oracle Corporation’s Oracle, Sun’s MySQL,
and IBM’s DB2.
c. Application programs and utility software are used to access and
manipulate data in the DBMS and to manage the computer environment in
which data access and manipulation take place. Application programs are most
commonly used to access data found within the database to generate reports,
tabulations, and other information to facilitate decision making. Utilities are
the software tools used to help manage the database system’s computer
components.
For example, all of the major DBMS vendors now provide graphical user
interfaces (GUIs) to help create database structures, control database access,
and monitor database operations.
• People: This component includes all users of the database system. On the
basis of primary job functions, five types of users can be identified in a
database system: system administrators, database administrators,
database designers, system analysts and programmers, and end users.
Each user type, described below, performs both unique and complementary
functions.
a. System administrators: oversee the database system’s general operations.
b. Database administrators: also known as DBAs manage the DBMS and ensure
that the database is functioning properly.
c. Database designers: design the database structure. They are, in effect, the
database architects. If the database design is poor, even the best application
26
DATABASE MANAGEMENT SYSTEMS

programmers and the most dedicated DBAs cannot produce a useful database
environment.
d. System analysts and programmers: design and implement the application
programs. They design and create the data entry screens, reports, and
procedures through which end user’s access and manipulate the database’s
data.
e. End users: are the people who use the application programs to run the
organization’s daily operations. For example, salesclerks, supervisors,
managers, and directors are all classified as end users.
f. Procedures: Procedures are the instructions and rules that govern the design
and use of the database system. Procedures play an important role in a
company because they enforce the standards by which business is conducted
within the organization and with customers. Procedures are also used to
ensure that there is an organized way to monitor and audit both the data that
enter the database and the information that is generated through the use of
those data.
g. Data: The word data covers the collection of facts stored in the database.
Because data are the raw material from which information is generated, the
determination of what data are to be entered into the database and how those
data are to be organized is a vital part of the database designer’s job.

Centralized and Client/Server Architectures for DBMS's:

Centralized DBMS Architecture:


A centralized database is stored at a single location such as a mainframe computer. It
is maintained and modified from that location only and usually accessed using an
internet connection such as a LAN or WAN. The centralized database is used by
organizations such as colleges, companies, banks etc.

As can be seen from the above diagram, all the information for the organisation is
stored in a single database. This database is known as the centralized database.

Advantages:
Some advantages of Centralized Database Management System are:

27
DATABASE MANAGEMENT SYSTEMS

1. The data integrity is maximized as the whole database is stored at a single


physical location. This means that it is easier to coordinate the data and it is as
accurate and consistent as possible.
2. The data redundancy is minimal in the centralized database. All the data is
stored together and not scattered across different locations. So, it is easier to
make sure there is no redundant data available.
3. Since all the data is in one place, there can be stronger security measures
around it. So, the centralized database is much more secure.
4. Data is easily portable because it is stored at the same place.
5. The centralized database is cheaper than other types of databases as it
requires less power and maintenance.
6. All the information in the centralized database can be easily accessed from the
same location and at the same time.

Disadvantages:
Some disadvantages of Centralized Database Management System are:

1. Since all the data is at one location, it takes more time to search and access it.
If the network is slow, this process takes even more time.
2. Since all the data is at the same location, if multiple users try to access it
simultaneously it creates a problem. This may reduce the efficiency of the
system.
3. If there are no database recovery measures in place and a system failure
occurs, then all the data in the database will be destroyed.

Below figure illustrates the physical components in centralized database:

Basic Client/Server Architectures:


In client server computing, the clients request a resource and the server provides that
resource. A server may serve multiple clients at the same time while a client is in
contact with only one server.

28
DATABASE MANAGEMENT SYSTEMS

Client/Server Structure:
The client/server architecture was developed to deal with computing environments
in which a large number of PCs, workstations, file servers, printers, database servers,
Web servers, e-mail servers, and other software and equipment are connected via a
network. The idea is to define specialized servers with specific functionalities.
For example, it is possible to connect a number of PCs or small workstations as
clients to a file server that maintains the files of the client machines. Another
machine can be designated as a printer server by being connected to various
printers; all print requests by the clients are forwarded to this machine.

The client machines provide the user with the appropriate interfaces to utilize these
servers, as well as with local processing power to run local applications.
An illustration of the client/server structure is as follows−

Database client –server architecture is divided into 2 types

• Two-tier Client/Server Architecture

• Three-tier Client/Server Architecture

Two-tier Client / Server Architecture :


The two tier architecture primarily has two parts, a client tier and a server tier. The
client tier sends a request to the server tier and the server tier responds with the
desired information.

An example of a two tier client/server structure is a web server. It returns the required
web pages to the clients that requested them.

Two-tier Client / Server architecture is used for user


Interface program and Application Programs that runs
on client side. An interface called ODBC (Open
Database Connectivity) provides an API that allows
client side program to call the DBMS. Most DBMS
vendors provide ODBC drivers. A client program may
connect to several DBMS's. In this architecture some
variation of client is also possible. For example in some
DBMS's more functionality is transferred to the client
including data dictionary, optimization etc. Such
clients are called Data server.

29
DATABASE MANAGEMENT SYSTEMS

Advantages of Two - Tier Client/Server Structure:

• This structure is quite easy to maintain and modify.


• The communication between the client and server in the form of request
response messages is quite fast.
Disadvantages of Two - Tier Client/Server Structure:

• If the client nodes are increased beyond capacity in the structure, then the
server is not able to handle the request overflow and performance of the
system degrades
Three-tier Client / Server Architecture
Three-tier Client / Server database architecture is
commonly used architecture for web applications.
Intermediate layer called Application server or Web
Server stores the web connectivity software and the
business logic (constraints) part of application used
to access the right amount of data from the
database server. This layer acts like medium for
sending partially processed data between the
database server and the client.

Advantages:

• The three-tier structure provides much better service and fast performance.
• The structure can be scaled according to requirements without any problem.
• Data security is much improved in the three-tier structure.
Disadvantages:

• Three - tier client/server structure is quite complex due to advanced features.

Classification of Database Management Systems:

1. Based upon data model:


• Hierarchical Model
• Network Model
• Relational Model
• Entity-Relationship model
• Object-oriented data model
2. Based on no. of users:
• Single-user Systems –Supports only one user at a time and mostly used with
personal computers.
• Multi-user Systems- supports multiple users concurrently.

30
DATABASE MANAGEMENT SYSTEMS

3. Based on number of sites:


• Centralized database: data is stored at a single computer site. It also
supports multiple users but the DBMS and database reside totally at a single
computer site.
• Distributed DBMS: can have the actual database and DBMS software
distributed over many sites, connected by a computer network.
Distributed DBMS is classified as homogenous DDBMS and Heterogeneous
DDBMS
Homogeneous DDBMSs use the same DBMS software at all the sites, whereas
heterogeneous DDBMSs can use different DBMS software at each site.

4. Based on types of access path:


DBMS can be general purpose or special purpose. When performance is a primary
consideration, a special-purpose DBMS can be designed and built for a specific
application; such a system cannot be used for other applications without major changes.
Many airline reservations and telephone directory systems developed in the past are
special-purpose DBMSs. These fall into the category of online transaction
processing (OLTP) systems, which must support a large number of concurrent
transactions without imposing excessive delays.

31

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