CHAPTER 1 UNIT- I
CHAPTER 1 - DATABASE AND DATABASE USERS
INTRODUCTION
Databases and database technology have a major impact on the growing use of computers. It is fair to say that
databases play a critical role in almost all areas where computers are used, including business, electronic
commerce, engineering, medicine, genetics, law, education, and library science.
Database: Collection of related data with implicit meanings, data which mean facts that can be recorded and
having implicit meaning e.g.: name, telephone number, address, etc.
1. Traditional Databases: Information stored in textual or numeric format.
2. Multimedia Databases: Stores pictures, videos clips, sound etc.
Applications : .e.g.: Engineering, Medicine, Commerce, Law and Education & Library science
Properties:
• Databases are a different coherent collection of information with some inherent meaning. A randomized
collection cannot correctly be referred to as db.
• A Database is designed, built & populated with data for specific purpose. It has an intended users and
applications in which these users are interested.
• A Database represent some aspect of real world sometimes called Mini world or UoD(Universe of Discourse).
Changes in this will be reflected in the databases. Huge amount of information must be organized & managed for
that.
• Search for data, retrieves data and updates data as needed.
'
Example of Database :- Student database, bank database, employee database
DBMS: It is a collection of program that enables to create and maintain database. Is a general purpose software
system that facilitates the process of Defining, Constructing, Manipulating & Sharing data among various users
and applications.
Defining: Involves specify the data types structures and constraints (Conditions) for the data to be stored.
Constructing: It is the process of the storing the data itself on some storage medium that is controlled by DBMS
Manipulating: Querying for retrieve\update to reflect changes.
Sharing: Multiple users and programs to access same database concurrently by DBMS Users/Programs
Example of DBMS:- ORACLE, DB2, SQL SERVER
As shown in the fig database and DBMS software together is a database system.
FIG 1.1: A simplified database system environment.
Mrs. Shwetha H Perody, Sri Ramakrishna College, Mangaluru Page 1
CHAPTER 1 UNIT- I
An Example
A UNIVERSITY database maintains information concerning students, courses, and grades in a university
environment. Figure 1.2 shows the database structure and a few sample data for such a database. The database is
organized as five files, each of which stores data records of the same type. The STUDENT file stores data on each
student, the COURSE file stores data on each course, the SECTION file stores data on each section of a course, the
GRADE_REPORT file stores the grades that students receive in the various sections they have completed, and the
PREREQUISITE file stores the prerequisites of each course.
1.2 E.g.: A database that stores student and course information.
Mrs. Shwetha H Perody, Sri Ramakrishna College, Mangaluru Page 2
CHAPTER 1 UNIT- I
To define this database, we must specify the structure of the records of each file by specifying the different types of
data elements to be stored in each record. each STUDENT record includes data to represent the student’s Name,
Student_number, Class (such as freshman or ‘1’, sophomore or ‘2’, and so forth), and Major (such as mathematics
or ‘MATH’ and computer science or ‘CS’); each COURSE record includes data to represent the Course_name,
Course_number, Credit_hours, and Department (the department that offers the course); and so on. We must also
specify a data type for each data element within a record. For example, we can specify that Name of STUDENT is
a string of alphabetic characters, Student_number of STUDENT is an integer, and Grade of GRADE_REPORT is a
single
character from the set {‘A’, ‘B’, ‘C’, ‘D’, ‘F’, ‘I’}.We may also use a coding scheme to represent the values of a
data item. For example, in Figure 1.2 we represent the Class of a STUDENT as 1 for freshman, 2 for sophomore, 3
for junior, 4 for senior, and 5 for graduate student.
To construct the University database, we store data to represent each student, course, section, course, grade report
and prerequisite as a record in the appropriate file. Notice that records in the various files may be related. For
example, the record for the “smith” in the STUDENT file is related to two records in the GRADE_REPORT file
that specify Smith’s grades in two sections.
Database manipulation involves querying and updating. Examples of queries are as follows:
■ Retrieve the transcript—a list of all courses and grades—of ‘Smith’
■ List the names of students who took the section of the ‘Database’ course offered in fall 2008 and their grades in
that section
■ List the prerequisites of the ‘Database’ course
Examples of updates include the following:
■ Create a new section for the ‘Database’ course for this semester
■ Enter a grade of ‘A’ for ‘Smith’ in the ‘Database’ section of last semester
Mrs. Shwetha H Perody, Sri Ramakrishna College, Mangaluru Page 3
CHAPTER 1 UNIT- I
CHARACTERISTICS OF DATABASE APPROACH VERSUS THE FILE-PROCESSING
APPROACH:
In the database approach, a single repository maintains data that is defined once and then accessed by various
users. In file systems, each application is free to name data elements independently. In contrast, in a database, the
names or labels of data are defined once, and used repeatedly by queries, transactions, and applications. The main
characteristics of the database approach versus the file-processing approach are the following:
■ Self-describing nature of a database system
■ Insulation between programs and data, and data abstraction
■ Support of multiple views of the data
■ sharing of data and multiuser transaction processing
1 Self describing nature of Database systems: Complete definitions and structure and constraints are stored in
DBMS catalog. Information stores in DBMS catalog is called as META DATA. This catalog can be used by db
software and users. DBMS software works along with any number of Databases applications, university data base,
banking, company database as along with Database definition is stored in catalog.
2 Insulation between programs data and data abstractions:
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 We call this property program-data independence.
In some types of database systems, such as object-oriented and object-relational systems, users can define
operations on data as part of the database definitions. An operation (also called a function or method) is specified
in two parts. The interface (or signature) of an operation includes the operation name and the data types of its
arguments (or parameters). The implementation (or method) of the operation is specified separately and can be
changed without affecting the interface. User application programs can operate on the data by invoking these
operations through their names and arguments, regardless of how the operations are implemented. This may be
termed program-operation independence. The characteristic that allows program-data independence and
program-operation
Independence is called data abstraction.
A DBMS provides users with a conceptual representation of data that does not include many of the details of
how the data is stored or how the operations are implemented. Informally, a data model is a type of data
abstraction that is used to provide this conceptual representation. The data model uses logical concepts, such as
objects, their properties, and their interrelationships, that may be easier for most users to understand than computer
storage concepts. Hence, the data model hides storage and implementation details that are not of interest to most
database users.
3 Supports multiple view of data:
A database typically has many 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.
4 Sharing of data and multiple users transaction processing:
A multiuser DBMS, as its name implies, must allow multiple users to access the database at the same time. This is
essential if data for multiple applications is to be integrated and maintained in a single database. The DBMS must
include concurrency control software to ensure that several users trying to update the same data do so in a
controlled manner so that the result of the updates is correct. For example, when several reservation agents try to
assign a seat on an airline flight, the DBMS should ensure that each seat can be accessed by only one agent at a
time for assignment to a passenger. These types of applications are generally called online transaction processing
(OLTP) applications. A fundamental role of multiuser DBMS software is to ensure that concurrent transactions
operate correctly and efficiently.
A transaction is an executing program or process that includes one or more database accesses, such as reading or
updating of database records. Each transaction is supposed to execute a logically correct database access if
executed in its entirety without interference from other transactions.
Isolation property says each transaction must be executed without affecting other transaction which are executing
currently. Atomicity Property ensures either all database operation is executed or none are.
Mrs. Shwetha H Perody, Sri Ramakrishna College, Mangaluru Page 4
CHAPTER 1 UNIT- I
ACTORS ON THE SCENE
For a small personal database, such as the list of addresses, one person typically defines, constructs, and
manipulates the database. However, many persons are involved in the design, use, and maintenance of a large
database with a few hundred users, in the section we identify the people whose jobs the day-to-day use of a large
database; we call them the "actors on the scene". we consider people who may be called "workers behind the
scene"--those who work to maintain the database system environment, but who are not actively interested in the
database itself.
1 Database Administrators
In any organization where many persons use the same resources, there is a need for a chief administrator to oversee
and manage these resources. In a database environment, the primary resource is the database and the secondary
resource is the DBMS and the related software. Administering these resources is the responsibility of the database
administrator (DBA).The DBA is responsible for authorizing access to the database .for coordinating and
monitoring its use, and for acquiring software and hardware resources and needed. The DBA is accountable for
problem such as breach of security system response time. In large organizations, the DBA is assisted by a staff that
helps carry out these functions.
2 Database Designers
Database designers are responsible for identifying the data to be stored in the database and for choosing
appropriate structures to represents and store this data. These tasks are mostly undertaken before the database is
actually implemented and populated with data. It is the responsibility of the database designers to communicate
with all respect prospective database users, in order to understand their requirements, and to come up with the
design that meets these requirements. In many cases, the designers on the staff of the DBA may be assigned other
staff responsibility after the database design is completed. Database designers typically interact with each potential
group of users and develop a view of the database that meets the data and processing requirements of this group.
These views are then analyzed and integrated with the views of other user groups. The final database design must
be capable of supporting the requirements of all user groups.
3 End Users
End users are the people whose jobs require access to the database for querying, updating, and generating reports;
the database primarily exists for their use there are several categories of end users:
• Casual end users occasionally access the database, but they may need different information each time. They use
a sophisticated database query language to specify their request and are typically middle-or high-level managers or
other occasional browsers.
• Nai've or parametric end users make up a sizable portion of database end users. Their main job function
revolves around constantly querying and updating the database, using standard types of queries and updates-called
canned transaction-that have been carefully programmed and tested. The tasks that such users perform are varied:
Bank tellers check account balances and post withdrawals and deposits. Reservation clerks for airlines,
hotels, and car rental companies check availability for a given request and make reservations.
Clerks at receiving stations for courier mail enter package identifications via barcodes and descriptive
information through buttons to update a central database of received and in-transit packages.
Sophisticated end users include engineers, scientists, business analysts, and others who thoroughly
familiarize themselves with the facilities of the DBMS so as to implement their applications to meet their
complex requirements.
• Stand-alone users maintain personal databases by using ready-made program packages that provide easy-to-use
menu-or graphics-based interfaces. An example is the user of a tax package that stores a variety of personal
financial data for tax purposes.
A typical DBMS provides multiple facilities to access a database. Naive end users need to learn very little about
the facilities provided by the DBMS; they have to understand only the types of standard transactions designed and
implemented for their use. Casual users learn only a few facilities that they may use repeatedly. Sophisticated users
try to learn most of the DBMS facilities in order to achieve their complex requirements. Stand-alone users typically
become very proficient in using a specific software package.
Mrs. Shwetha H Perody, Sri Ramakrishna College, Mangaluru Page 5
CHAPTER 1 UNIT- I
4 System Analysts and Application Programmers (Software Engineers)
System analysts determine the requirements of end users, especially naive and parametric end users, and develop
specifications for canned transactions that meet these requirements. Applications programmers implement these
specifications as programs; then they test, debug, document, and maintain these canned transactions. Such analysts
and programmers should-be familiar with the full range of capabilities provided by the DBMS to accomplish their
tasks.
WORKERS BEHIND THE SCENE
In addition to those who design, use, and administer a database, others are associated with the design, development,
and operation of the DBMS software and system environment. These persons are typically not interested in the
database itself. We call them the "workers behind the scene", and they include the following categories.
DBMS system designers and implementers are persons who design and implement the DBMS modules
and interfaces as a package. A DBMS is a complex software system that consists of many components or
modules, including modules for implementing the catalog, query language, interface processors, data
access, concurrency control, recovery, and security. The DBMS must interface with other system software,
such as operating system and compilers for various programming languages.
Tool developers include persons who design and implement tools-the software packages facilitates
database system designs and use, and help improve performance. Tools are optional packages that are often
purchased separately. They include package for database design, performance monitoring, natural language
or graphical interfaces, prototyping, simulation, and test data generation. In many cases, independent
software venders develop and market these tools.
Operation and maintenance personnel are the system administration personnel who are responsible for
the actual running and maintenance of the hardware and software environment for the database system.
Although the above categories of workers behind the scene are instrumental in making the data base
system available to end users, they typically do not use the database for their own purposes.
Advantages of DBMS:
1. Controlling redundancy: Redundancy means storing same data multiple times .This redundancy leads to
several problems. First, 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 the same data is stored repeatedly, and this problem may be
serious for large databases. 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. Even if an update—such as
adding a new student—is applied to all the appropriate files, the data concerning the student may still be
inconsistent since the updates are applied independently by each user group.
Eg.: One student enters DOB 19 Jan 1984; other user groups enter DOB 29 Jan 1984. Student name or
DOB is stored in only one place at the database. These ensure consistency and save storage space.
Redundancy control improves the performance of queries.
2. Restricting authorized data: When multiple users share a database, it is likely that some users will not be
authorized to access all information in the database. For example, financial data is often considered
confidential, and hence only authorized persons are allowed to access such data. In addition, some users
may be permitted only to retrieve data, whereas others are allowed both to retrieve and to update. Hence,
the type of access operation—retrieval or update—must also be controlled. Typically, users or user groups
are given account numbers protected by passwords, which they can use to gain access to the database. A
DBMS should provide a security and authorization subsystem, which the DBA uses to create accounts
and to specify account restrictions.
3. Providing Persistent Storage for Program Objects and Data Structures Databases can be used to
provide persistent storage for program objects and data structures. This is one of the main reasons for the
emergence of the object-oriented database systems. Programming languages typically have complex data
structures, such as record types in PASCAL or class definitions in C++. The values of program variables
are discarded once a program terminates, unless the programmer explicitly stores them in permanent files,
which often involves converting these complex structures into a format suitable for file storage. When the
need arises to read this data once more, the programmer must convert from the file format to the program
variable structure. Object-oriented database systems are compatible with programming languages such as
Mrs. Shwetha H Perody, Sri Ramakrishna College, Mangaluru Page 6
CHAPTER 1 UNIT- I
C++ and JAVA, and the DBMS software automatically performs any necessary conversions. Such an
object is said to be persistent, since it survives the termination of program execution and can later be
directly retrieved by another C++ program.
4. Providing storage structure for efficient query: Db provide capabilities for efficiently executing queries
& updates. Provide specialized data structure for speed up the disc search (db are stored on disc) for
specific record. Auxiliary files called index are used for disc to memory (buffering).
5. Provide backup and recovery: A DBMS must provide facilities for recovering from hardware or software
failures. The backup and recovery subsystem of the DBMS is responsible for recovery. For example, if
the computer system fails in the middle of a complex update program, the recovery subsystem is
responsible for making sure that the database is restored to the state it was in before the program started
executing. Alternatively, the recovery subsystem could ensure that the program is resumed from the point at
which it was interrupted so that its full effect is recorded in the database.
6. Provide multiple user interfaces: Because many types of users with varying levels of technical knowledge
use a database, a DBMS should provide a variety of user interfaces. These include query languages for
casual users; programming language interfaces for application programmers; forms and command codes for
parametric users; and menu-driven interfaces and natural language interfaces for stand-alone users. Both
forms-style interfaces and menu-driven interfaces are commonly known as graphical user interfaces
(GUIs). Many specialized languages and environments exist for specifying GUIs. Capabilities for
providing World Wide Web access to a database—or web-enabling a database—are also becoming
increasingly common.
7. Representing complex relationship among data:
A database may include numerous varieties of data that are interrelated in many ways. Consider the
example shown in Figure 01.02. The record for Brown in the student file is related to four records in the
GRADE_REPORT file. Similarly, each section record is related to one course record as well as to a number
of GRADE_REPORT records—one for each student who completed that section. A DBMS must have the
capability to represent a variety of complex relationships among the data as well as to retrieve and update
related data easily and efficiently.
8. Enforcing integrity constraints:
Most database applications have certain integrity constraints that must hold for the data. A DBMS should
provide capabilities for defining and enforcing these constraints. The simplest type of integrity constraint
involves specifying a data type for each data item. For example, in Figure 01.02, we may specify that the
value of the Class data item within each student record must be an integer between 1 and 5 and that the
value of Name must be a string of no more than 30 alphabetic characters. A more complex type of
constraint that occurs frequently involves specifying that a record in one file must be related to records in
other files. For example, in Figure 01.02, we can specify that "every section record must be related to a
course record." Another type of constraint specifies uniqueness on data item values, such as "every course
record must have a unique value for CourseNumber."
Some constraints automatically executed & other constraints must be executed at the time
of execution (during data entry).
Eg:- garade from A-D is valid-change will not show errors. Z-> not valid=>show error.
9. Permitting Inferencing and Actions Using Rules
Deduction rule: Used to inferring new info: from the stored data base. Such systems are called deductive
data base systems.
Some database systems provide capabilities for defining deduction rules for inferencing new information
from the stored database facts. Such systems are called deductive database systems. For example, there
may be complex rules in the miniworld application for determining when a student is on probation. These
can be specified declaratively as rules, which when compiled and maintained by the DBMS can determine
all students on probation. In a traditional DBMS, an explicit procedural program code would have to be
written to support such applications. But if the miniworld rules change, it is generally more convenient to
change the declared deduction rules than to recode procedural programs. More powerful functionality is
provided by active database systems, which provide active rules that can automatically initiate actions.
ADDITIONAL IMPLICATION OF USING DATABASE APPROACH:
1) Potential for Enforcing Standards
The database approach permits the DBA to define and enforce standards among database users in a large
organization. This facilitates communication and cooperation among various departments, projects, and users
within the organization. Standards can be defined for names and formats of data elements, display formats, report
structures, terminology, and so on. The DBA can enforce standards in a centralized database environment more
easily than in an environment where each user group has control of its own files and software.
Mrs. Shwetha H Perody, Sri Ramakrishna College, Mangaluru Page 7
CHAPTER 1 UNIT- I
2) Reduced Application Development Time
A prime selling feature of the database approach is that developing a new application—such as the retrieval of
certain data from the database for printing a new report—takes very little time. Designing and implementing a new
database from scratch may take more time than writing a single specialized file application. However, once a
database is up and running, substantially less time is generally required to create new applications using DBMS
facilities. Development time using a DBMS is estimated to be one-sixth to one-fourth of that for a traditional file
system.
3) Flexibility
It may be necessary to change the structure of a database as requirements change. For example, a new user group
may emerge that needs information not currently in the database. In response, it may be necessary to add a file to
the database or to extend the data elements in an existing file. Modern DBMSs allow certain types of changes to
the structure of the database without affecting the stored data and the existing application programs.
4) Availability of Up-to-Date Information
A DBMS makes the database available to all users. As soon as one user’s update is applied to the database, all
other users can immediately see this update. This availability of up-to-date information is essential for many
transaction-processing applications, such as reservation systems or banking databases, and it is made possible by
the concurrency control and recovery subsystems of a DBMS.
5) Economies of Scale
The DBMS approach permits consolidation of data and applications, thus reducing the amount of wasteful overlap
between activities of data-processing personnel in different projects or departments. This enables the whole
organization to invest in more powerful processors, storage devices, or communication gear, rather than having
each department purchase its own (weaker) equipment. This reduces overall costs of operation and management.
******************************
Mrs. Shwetha H Perody, Sri Ramakrishna College, Mangaluru Page 8