DBMS Chapter 1
DBMS Chapter 1
DBMS Chapter 1
I. Data :-
“A collection of raw facts and figures.”
Computer data is information processed or stored by a
computer.
This information may be in the form of text documents,
images, audio clips, software programs, or other types of
data.
computer data is a bunch of ones and zeros, known as
binary data.
II. Database:-
A Database is a collection of interrelated data organised in a
way that data can be easily accessed, managed and updated.
Database can be software based or hardware based, with one
sole purpose, storing data.
Banking: transactions
Internal Level:
3. The conceptual level does not care for how the data in the
database is actually stored.
External Level:-
Components of DBMS:
1. Query Processor :
(a) DML Compiler
(b) Embedded DML pre-compiler
(c) DDL Interpreter
(d) Query Evaluation Engine
2. Storage Manager :
(a) Authorization and Integrity Manager
(b) Transaction Manager
(c) File Manager
(d) Buffer Manager
3. Data Structure :
(a) Data Files
(b) Data Dictionary
(c) Indices
(d) Statistical Data
1. Database Users:-
Users are differentiated by the way they expect to interact with
the system: Application programmers:
Application programmers:-
i. Application programmers are computer professionals
who write application programs. Application
programmers can choose from many tools to develop
user interfaces.
ii. Rapid application development (RAD) tools are tools
that enable an application programmer to construct
forms and reports without writing a program.
Sophisticated users:
Sophisticated users:-
i. Sophisticated users interact with the system without
writing programs. Instead, they form their requests in
a database query language.
ii. They submit each such query to a query processor,
whose function is to break down DML statements
into instructions that the storage manager
understands.
Specialized users :-
i. Specialized users are sophisticated users who write
specialized database applications that do not fit into
the traditional data-processing framework.
ii. Among these applications are computer-aided design
systems, knowledge base and expert systems, systems
that store data with complex data types (for example,
graphics data and audio data), and environment-
modeling systems.
Naive users :-
i. Naive users are unsophisticated users who interact
with the system by invoking one of the application
programs that have been written previously.
ii. For example, a bank teller who needs to transfer $50
from account A to account B invokes a program called
transfer. This program asks the teller for the amount of
money to be transferred, the account from which the
money is to be transferred, and the account to which
the money is to be transferred.
Database Administrator:-
Coordinates all the activities of the database system. The
database administrator has a good understanding of the
enterprise’s information resources and needs.
Database administrator's duties include:
i. Schema definition: The DBA creates the original
database schema by executing a set of data definition
statements in the DDL.
ii. Storage structure and access method definition.
iii. Schema and physical organization modification: The
DBA carries out changes to the schema and physical
organization to reflect the changing needs of the
organization, or to alter the physical organization to
improve performance.
iv. Granting user authority to access the database: By
granting different types of authorization, the database
administrator can regulate which parts of the database
various users can access.
v. Specifying integrity constraints.
vi. Monitoring performance and responding to changes in
requirements.
2. Query Processor Components:-
i. DML Pre-compiler : It translates DML statements in a
query language into low level instructions that query
evaluation engine understands. It also attempts to
transform user's request into an equivalent but more
efficient form.
ii. Embedded DML Pre-compiler : It converts DML
statements embedded in an application program to
normal procedure calls in the host language. The Pre-
compiler must interact with the DML compiler to
generate the appropriate code.
iii. DDL Interpreter : It interprets the DDL statements and
records them in a set of tables containing meta data or
data dictionary.
iv. Query Evaluation Engine : It executes low-level
instructions generated by the DML compiler.
3. Storage Manager Components:-
They provide the interface between the low-level data stored in
the database and application programs and queries submitted to
the system.
i. Authorization and Integrity Manager : It tests for the
satisfaction of integrity constraints checks the authority
of users to access data.
ii. Transaction Manager : It ensures that the database
remains in a consistent state despite the system failures
and that concurrent transaction execution proceeds
without conflicting.
iii. File Manager : It manages the allocation of space on disk
storage and the data structures used to represent
information stored on disk.
iv. Buffer Manager : It is responsible for fetching data from
disk storage into main memory and deciding what data to
cache in memory.
4. Data Structures:-
Following data structures are required as a part of the physical
system implementation.
i. Data Files : It stores the database.
ii. Data Dictionary : It stores meta data (data about data)
about the structure of the database.
iii. Indices : Provide fast access to data items that hold
particular values.
iv. Statistical Data : It stores statistical information about the
data in the database. This information is used by query
processor to select efficient ways to execute query.
1.2 Architecture:-
i. Two tier architecture of database:-
a. The 2-Tier architecture is same as basic client-server.
In the two-tier architecture, applications on the client
end can directly communicate with the database at the
server side. For this interaction, API's like: ODBC,
JDBC are used.
b. The user interfaces and application programs are run
on the client-side.
c. The server side is responsible to provide the
functionalities like: query processing and transaction
management.
d. To communicate with the DBMS, client-side
application establishes a connection with the server
side.
Advantages:-
a. Simplicity: Two-tier architecture is simple and
easy to understand, as it involves only two
components: the client and the server.
Advantages:-
a. Scalability: The architecture can be easily scaled by
adding more servers or upgrading existing servers,
improving performance, and ensuring high
availability.
b. Increased Security: The three-tier architecture
provides a clear separation of responsibilities, which
makes it easier to secure data and control access to the
database.
c. Improved Maintenance: The architecture makes it
easier to maintain and upgrade the system, as changes
can be made to one tier without affecting the others.
d. Reusability: The business logic can be centralized in
the application tier, making it easier to reuse and share
across different applications.
1.3 Data Models:-
i. “Data model is a collection of concepts that can be used to describe the
structure of database.” A Database model defines the logical design and
structure of a database and defines how data will be stored, accessed and
updated in a database management system.
Types of data model:
1. Record based model
a. Hierarchical Data Models
b. Network Data Models
c. Relational Data Models
2. Entity-relationship Model
1. Record based model:-
A record based data model is used to specify the overall logical structure
of the database.
a. Hierarchical Model: This database model organizes data into a
tree-like-structure, with a single root, to which all the other data is
linked. The hierarchy starts from the Root data, and expands like a
tree, adding child nodes to the parent nodes. Example: one
department can have many courses, many professors and of-course
many students