You are on page 1of 38

Introduction to Database

Systems
Course Outcomes
 Understand the database concepts.
 Apply procedural and non-procedural language constructs to manage database
system.
 Design database using data modelling tool and normalization concepts.
 Describe transaction management and concurrency control concepts.
 Interpret the unstructured databases.

27 Oct 2023 Dept. Of I&CT 2


Reference Books
• Abraham Silberschatz, Henry Korth F., Sudarshan S., “Database system
concepts (6e)”, McGraw-Hill, 2013
• Elmasri, Ramez, Sham Navathe, “Fundamentals of database systems (7e)”,
Pearson, 2016
• Molina, Hector, Jeffrey Ullman D., Jennifer Widom, “Database systems, The
Complete Book (2e)”, Pearson Prentice Hall, 2013
• Chodorow Kristina, “MongoDB: The definitive guide (2e)”, O’Reilly, 2013.

27 Oct 2023 Dept. Of I&CT 3


Introduction
• In the traditional approach, we used to store information in flat files which are
maintained by the file system under the operating system’s control.
• Here, flat files are files containing records having no structured relationship
among them.
• The file handling which we learn under C/C ++ is the example of file
processing system.
• The Application programs written in C/C ++ like programming languages go
through the file system to access these files.

27 Oct 2023 Dept. Of I&CT 4


Drawbacks of using File System
• Data Redundancy and Inconsistency
- Multiple file formats, duplication of information in different files
• Difficulty in accessing the data
- Need to write a new program to carry out each new task
• Data Isolation - multiple files and formats
• Integrity Problems
- Integrity constraints (e.g., account balance > 0) become “buried” in problem
code rather than being stated explicitly
- Hard to add new constraints or change the existing ones

27 Oct 2023 Dept. Of I&CT 5


Drawbacks of using File System
• Atomicity of Updates
- Failures may leave database in an inconsistent state with partial updates carried
out
- Example: Transfer of funds from one account to another should either complete
or not happen at all
• Concurrent access by multiple users
- Concurrent access needed for performance
- Uncontrolled concurrent accesses can lead to inconsistencies Example: Two
people reading a balance (say 100) and updating it by withdrawing money (say
50 each) at the same time
• Security problems
- Hard to provide user access to some, but not all, data
27 Oct 2023 Dept. Of I&CT 6
Database; Database Management System; Database System

• A database is a collection of related data


• Data – known facts that can be recorded and that have implicit meaning.
• However, database has the following properties:
 It represents some aspects of real-world, called miniworld or the
universe of discourse (UoD). Changes to the miniworld are reflected in
database.
 It is logically coherent collection of data with some inherent meaning
 It is designed, built and populated with data for a specific purpose

27 Oct 2023 Dept. Of I&CT 7


27 Oct 2023 Dept. Of I&CT 8
Database; Database Management System; Database System

• A database (DB), has some source from which the data is derived, some degree
of interaction with events in the real world and an audience that is actively
interested in its contents.
• A DB can be of any size and complexity
• A DB may be generated and maintained manually, or it may be computerized.
• A Database Management System (DBMS) is a computerized system that
enables users to create and maintain a database.
• A DBMS is a general-purpose software system that facilitates the process of
defining, constructing, manipulating, and sharing databases among various
users and applications.

27 Oct 2023 Dept. Of I&CT 9


Database; Database Management System; Database System

• Defining a DB involves specifying the data types, structures and constraints of


the data to be stored in the DB.
• DB catalog or dictionary called meta-data
• Constructing the DB is the process of storing the data on some storage
medium that is controlled by DBMS.
• Manipulating a DB includes functions such as querying the DB to retrieve
specific data, updating the DB to reflect changes in the miniworld and
generating reports from the data.
• Sharing a DB allows multiple users and programs to access the DB
simultaneously.

27 Oct 2023 Dept. Of I&CT 10


Database; Database Management System; Database System

• An application program access the DB by sending queries or requests for data


to the DBMS
• A query typically causes some data to be retrieved
• A transaction may cause some data to be read and some data to be written into
DB.
• DB also provides:
• Protection includes system protection against hardware or soft- ware
malfunction (crashes) and security protection against unauthorized or malicious
access.
• The DBMS must be able to maintain the DBS by allowing the system to
evolve as requirements change over time.
27 Oct 2023 Dept. Of I&CT 11
Database; Database Management System; Database System

Simplified database system environment


27 Oct 2023 Dept. Of I&CT 12
Characteristics of DB Approach
1. Self describing nature of Database System
2.Insulation between programs and data, data abstraction
3. Support of multiple views of data
4. Sharing of data and multiuser transaction processing

27 Oct 2023 Dept. Of I&CT 13


Self describing nature of Database System
• Use of meta-data since a general-purpose DBMS is not written to serve a
specific purpose.
• In file system, data definitions are part of the application programs and are
constrained to work with only one specific database whose structure is declared
in the application program.

27 Oct 2023 Dept. Of I&CT 14


Self describing nature of Database System

Example of DB catalog
27 Oct 2023 Dept. Of I&CT 15
Insulation between programs and data, data abstraction

• In file system, changes to the structure of the file may require changing all the
programs that access the file.
• Structure of the data files is stored in the DBMS catalog separately from access
programs in DBS and the property is called Program- data independence
• Program-Operation independence: User application programs can operate on
the data by invoking the operations through their names and arguments,
regardless of how the operations are implemented.

27 Oct 2023 Dept. Of I&CT 16


Insulation between programs and data, data abstraction

• Characteristic that allows program data independence and program operation


independence is called data abstraction.
• DBMS provides the users with conceptual representation of data that does
not include many of the details as to how the operations are implemented.
• Data Model is a type of data abstraction that is used to provide the conceptual
representation.

27 Oct 2023 Dept. Of I&CT 17


Insulation between programs and data, data abstraction

Data Model and Internal storage format for STUDENT record

27 Oct 2023 Dept. Of I&CT 18


Support of Multiple Views of Data
• A DB has many users, each of them may need different perspective or view
of the DB.
• A view may be a subset of the DB or it may contain virtual data that is
derived from the DB files but is not explicitly stored.

27 Oct 2023 Dept. Of I&CT 19


Sharing of Data and Multiuser transaction Processing
• Essential if data for multiple applications is to be integrated and maintained in
a single DB.
• DBMS must include concurrency control software to ensure that several users
trying to update the same data, do so in a controlled manner (Online
Transaction Processing (OLTP)applications).
• A transaction is an executing program or process that includes one or more
DB accesses, such as reading or updating of DB records.
• DBMS must enforce certain transaction properties - ACID (Atomicity,
Consistency, Isolation, Durability)

27 Oct 2023 Dept. Of I&CT 20


Actors on the Scene
1.Database Administrators (DBA)
-Administering the resources such as the DB (primary resource), DBMS and
related software (secondary resource)
-Responsible for authorizing access to the database, coordinating and
monitoring its use, and acquiring software and hardware re- sources as needed
-Accountable for problems such as security breaches and poor system response
time
2.Database Designers
-Responsible for identifying the data to be stored in the database and for
choosing appropriate structures to represent and store this data

27 Oct 2023 Dept. Of I&CT 21


Actors on the Scene
-It is the responsibility of database designers to communicate with all
prospective database users in order to understand their requirements and to
create a design that meets these requirements
-Typically interact with each potential group of users and develop views of the
database that meet the data and processing requirements of these groups
3.End Users
• The people whose jobs require access to the database for querying, updating,
and generating reports; the database primarily exists for their use.

27 Oct 2023 Dept. Of I&CT 22


End users:
1. 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 requests and
are typically middle- or high-level managers or other occasional browsers.
-Learn only a few facilities that they may use repeatedly.
2. Naive or parametric end users: Their main job function revolves around
constantly querying and updating the database, using standard types of queries
and updates called canned transactions-that have been carefully programmed
and tested
- Understand the user interfaces of the standard transactions designed and
implemented for their use.
27 Oct 2023 Dept. Of I&CT 23
End users
3. Sophisticated end users include engineers, scientists, business analysts, and
others who thoroughly familiarize themselves with the facilities of the DBMS
in order to implement their own applications to meet their complex
requirements.
- Try to learn most of the DBMS facilities in order to achieve their complex
requirements.
4. Standalone users maintain personal databases by using ready-made program
packages that provide easy-to-use menu-based or graphics-based interfaces.
- Become very proficient in using a specific software package

27 Oct 2023 Dept. Of I&CT 24


Actors on the Scene
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 standard canned
transactions that meet these requirements.
• Application programmers implement these specifications as programs; then
they test, debug, document, and maintain these canned transactions.

27 Oct 2023 Dept. Of I&CT 25


Workers behind the Scene
1.DBMS system designers and implementers are persons who
design and implement the DBMS modules and interfaces as a
software package.

2. Tool developers include persons who design and implement


tools—the software packages that facilitate database system
design and use, and help improve performance.

3. Operators and maintenance personnel (system


administration personnel) are responsible for the actual running
and maintenance of the hardware and software environment for
the database system.

Slide 1- 26
Advantages of Using DBMS Approach
1. Controlling Redundancy
2. Restricting Unauthorized Access
3. Providing Persistent Storage for Program Objects
4. Providing Storage Structures and Search Techniques for Efficient Query Processing
5. Providing Backup and Recovery
6. Permitting Inferencing and Actions Using Rules
7. Providing Multiple User Interfaces
8. Enforcing Integrity Constraints

27 Oct 2023 Dept. Of I&CT


Controlling Redundancy
• In file system, possible multiple file formats, duplication of information in
different files resulting in duplication of effort, wastage of space,
inconsistency.
• In the database approach, data is stored only one place known as Data
Normalization
• Sometimes there is a need for controlled redundancy

27 Oct 2023 Dept. Of I&CT


Restricting Unauthorized Access
• When multiple users share a database, it is likely that most users will not be
authorized to access all information in the database.
• Some users may only be permitted to retrieve data, whereas others are
allowed to retrieve and update
• DBMS should provide a security and authorization subsystem, which the
DBA uses to create accounts and to specify account restrictions.

27 Oct 2023 Dept. Of I&CT


Providing Persistent Storage for Program Objects
• Programing languages have complex data structures and the values of the
variables or objects are discarded once the program termi- nates.
• Storing the data in permanent files requires converting these complex data
structures into a format suitable for file storage and vise versa.
• Object oriented database systems, using DBMS to do the task and such an
object is said to be persistent

27 Oct 2023 Dept. Of I&CT


Providing Storage Structure and Search Techniques for
Efficient Query processing
• Database is typically stored on disk, the DBMS must provide specialized data
structures and search techniques to speed up disk search for the desired
records.
• Indexes are typically based on tree data structures or hash data structures that
are suitably modified for disk search.

27 Oct 2023 Dept. Of I&CT


Providing Backup and Recovery
• Backup and recovery subsystem of the DBMS is responsible for recovery from
hardware or software failures.
• Recovery subsystem is responsible for making sure that the database is restored
to the state it was in before the transaction started executing.
• Alternatively, the recovery subsystem could ensure that the transaction is
resumed from the point at which it was interrupted so that its full effect is
recorded in the database

27 Oct 2023 Dept. Of I&CT


Permitting Inferencing and Actions Using Rules
• 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.
• A trigger is a form of a rule activated by updates to the table, which results in
performing some additional operations to some other tables, sending
messages, and so on
• Stored procedures; they become a part of the overall database definition and
are invoked appropriately when certain conditions are met

27 Oct 2023 Dept. Of I&CT


Database Architecture
The architecture of a database systems is greatly
influenced by the underlying computer system on
which the database is running:
• Centralized
• Client-server
• Parallel (multi-processor)
• Distributed

34
D a ta b a seS y stem In tern a ls

At remote
site

35
Figure 1.06

36
• Database applications are partitioned into 2 or 3 parts
• In a two tier architecture, the application resides at the client machine where it
invokes database system functionality at the server machine through queries.
• API standards such as ODBC, JDBC are used for interaction between the client
and the server.

37
• In a 3 tier architecture, the client machine acts as a front end.
• The client machine communicates with the application server, usually through
forms
• The application server in turn communicates with a database system to access
data
• All logic is embedded in the application server.

38

You might also like