DBMS Chapter 1

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

Chapter1 : Introduction To Database System(12 Marks)

1.1 Database Concepts :-


The database system is an excellent computer-based record-keeping
system. A collection of data, commonly called a database, contains
information about a particular enterprise.

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.

III. Management System:-


 It is a set of programs to Store, update and access the data.

IV. Database Management System(DBMS):-


 “Database management system is collection of interrelated
data and set of programs to store and retrieve those data.”
Database management system is a software which is used to
manage the database.
 For example: MySQL, Oracle, etc… are a very popular
commercial database which is used in different applications.

V. File System Vs DBMS :-


 Drawbacks of using file systems to store data: Database
Management System (DMS) Advantages of DBMS over file
processing system :-
a. Data redundancy and inconsistency:-
 Multiple file formats, duplication of information in
different files
b. Difficulty in accessing data:-
 Need to write a new program to carry out each new
task
c. Data isolation:-
 Multiple files and formats
d. Integrity problems
 Integrity constraints (e.g., account balance > 0)
become “buried” in program code rather than being
stated explicitly
 Hard to add new constraints or change existing ones
e. Security problems
 Hard to provide user access to some, but not all, data

VI. Applications of DBMS :-

 Banking: transactions

 Airlines: reservations, schedules

 Universities: registration, grades

 Sales: customers, products, purchases

 Manufacturing: production, inventory, orders, supply


chain
 Human resources: employee records, salaries, tax
deductions

 Three Levels or layers of DBMS Architecture are:

 Internal Level:

1. This is the lowest level in the three level architecture.

2. It is also known as the physical level.

3. The physical level describes how data is actually stored in


the database.

4. In the lowest level, this data is stored in the external hard


drives in the form of bits and at a little high level, it can be
said that the data is stored in files and folders.

5. The physical level also discusses compression and


encryption techniques.
 Conceptual Level:

1. The conceptual level is at a higher level than the physical


level. It is also known as the logical level.

2. It describes how the database appears to the users


conceptually and the relationships between various data
tables.

3. The conceptual level does not care for how the data in the
database is actually stored.

 External Level:-

1. This is the highest level in the three level architecture and


closest to the user. It is also known as the view level.

2. The external level only shows the relevant database content


to the users in the form of views and hides the rest of the
data. So different users can see the database as a different
view as per their individual requirements.

VII. Data Abstraction:- “The process of hiding irrelevant detail from


user is called data abstraction.” There are mainly three levels of
data abstraction and we divide it into three levels in order to
achieve Data Independence. Three levels of data abstraction:

 Physical Level or Internal Schema:-

 As the name suggests, the Physical level tells us that


where the data is actually stored i.e. it tells the actual
location of the data that is being stored by the user.

 Describes how the data are stored.

 Conceptual Level or Logical Level:-


 This level tells how the data is actually stored and
structured.
 We have different data models by which we can store
the data.
 Describes what data are stored and what relationships
exit among those data.
 View Level or External Schema:-
 This level tells the application about how the data
should be shown to the user.
 Describes only part of the database for a particular
group of users.
 Instance:-
 “The data stored in database at a particular
moment of time is called instance of database. ”
 Database schema defines the variable declarations in
tables that belong to a particular database; the value of
these variables at a moment of time is called the
instance of that database.

VIII. Data Independence :-


“Data independence is ability to modify a schema definition in one
level without affecting a schema definition in the next higher
level.”
 Data Independence means users and data should not directly
interact with each other. The user should be at a different
level and the data should be present at some other level. By
doing so, Data Independence can be achieved. There are two
levels of data independence:
i. Physical Data Independence
ii. Logical Data Independence
 Physical Data Independence:-
i. Physical Data Independence is the ability to modify
the physical schema without requiring any change in
application programs.
ii. Modifications at the internal levels are occasionally
necessary to improve performance. possible
modifications at internal levels are change in file
structures, compression techniques, hashing
algorithms, storage devices, etc.
iii. Physical data independence separates conceptual
levels from the internal levels.
 Logical Data Independence:-
i. Logical data independence is ability to modify the
conceptual schema without requiring any change in
application programs.
ii. Modification at the logical levels are necessary
whenever the logical structures of the database is
altered.
iii. Logical data independence separates external level
from the conceptual view.
iv. it is difficult to achieve logical data independence.

IX. Database Schema:-


“The overall design of the database is called the database
schema.” There are two types of database schemas:
 Physical schema: database design at the physical
level.
 Logical schema: database design at the logical level.

X. Overall structure of DBMS :-

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.

b. Cost Effective: Two-tier architecture is less


expensive to implement and maintain compared
to three-tier or multi-tier architecture.

c. Ease of deployment: The client software can be


deployed on individual workstations, making it
easier to manage and update.

d. Direct Access to Database: The client has direct


access to the database, allowing for fast data
retrieval and update.

e. Client-side Processing: Some processing can be


done on the client side, reducing the load on the
server and improving performance.
f. Scalability: The architecture can be easily
scaled by adding more clients or upgrading the
server hardware.

g. Independence: The client and server can be


developed and deployed independently, which
can improve the overall development process.

ii. Three tier architecture of database:-


a. The 3-Tier architecture contains another layer between the
client and server. In this architecture, client can't directly
communicate with the server.
b. The application on the client-end interacts with an
application server which further communicates with the
database system.
c. End user has no idea about the existence of the database
beyond the application server. The database also has no idea
about any other user beyond the application.
d. The 3-Tier architecture is used in case of large web
application.

 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

b. Network Data Models:-


In the network model, the entities are organized in a graph, in
which some entities can be accessed through several paths.
Example: one department can have many courses, many professors
and of-course many students.

c. Relational Data Models:-


In the relational model, data is organized in two-dimensional
tables called relations. In this model the data can be stored in the
tables and this storing is called as relation, the relations can be
normalized and the normalized relation values are called atomic
values. Each row in a relation contains unique value and it is
called as tuple, each column contains value from same domain and
it is called as attribute.
Example: one department can have many courses, many professors
and of-course many students.

You might also like