0% found this document useful (0 votes)
97 views51 pages

Database System Concept

The document discusses the components and structure of a database management system (DBMS). It describes the main components as the query processor, storage manager, and data structures. The query processor includes a DML compiler, embedded DML pre-compiler, DDL interpreter, and query evaluation engine. The storage manager handles authorization, integrity, transactions, file management, and buffering. Data structures include data files, data dictionary, indices, and statistical data. The document also categorizes different types of DBMS users such as application programmers, sophisticated users, specialized users, and naïve users.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
97 views51 pages

Database System Concept

The document discusses the components and structure of a database management system (DBMS). It describes the main components as the query processor, storage manager, and data structures. The query processor includes a DML compiler, embedded DML pre-compiler, DDL interpreter, and query evaluation engine. The storage manager handles authorization, integrity, transactions, file management, and buffering. Data structures include data files, data dictionary, indices, and statistical data. The document also categorizes different types of DBMS users such as application programmers, sophisticated users, specialized users, and naïve users.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 51

Mr. S. Y. DIVEKAR.

Lecturer, Computer Engg. Dept.


Database Management System (DMS)
Database Management System (DMS)
Database Management System (DMS)
Unit-I:
DATABASE SYSTEM CONCEPT
(12 Marks)

Database Management System (DMS)


Topic :- 1 : Outlines
The concept of Data
Database,
DBMS,
Advantages of DBMS over file processing system,
Application of Database System.

Database Management System (DMS)


Database Management System (DBMS)

Database + Management + System


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.

Database Management System (DMS)


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.

Management System:
It is a set of programs to Store, update and access the data.

Database Management System (DMS)


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.

Database Management System (DMS)


Drawbacks of using file systems to store data:
Advantages of DBMS over file processing system :-
 Data redundancy and inconsistency
 Multiple file formats, duplication of information in different files
 Difficulty in accessing 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 program
code rather than being stated explicitly
 Hard to add new constraints or change existing ones
 Security problems
 Hard to provide user access to some, but not all, data

Database Management System (DMS)


DBMS Applications:
 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

Database Management System (DMS)


Topic :- 2 & 3 : Outlines
Three Levels of Architecture for Database
System.
Data Abstraction : Different levels of Data
Abstraction ,
Instance and schema,
Data Independence-
Logical Independence,
physical Independence.

Database Management System (DMS)


Three levels or layers of DBMS Architecture are:

External Level
How the data LOOK LIKE.
 Conceptual Level
What type of data is
actually stored.
 Internal Level
what data are stored and
how.

Database Management System (DMS)


Internal Level:
This is the lowest level in the three level architecture.
 It is also known as the physical level.
The physical level describes how data is actually stored in the database.
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.
The physical level also discusses compression and encryption techniques.
Conceptual Level
The conceptual level is at a higher level than the physical level. It is also known as the
logical level.
 It describes how the database appears to the users conceptually and the relationships
between various data tables.
The conceptual level does not care for how the data in the database is actually stored.
External Level
This is the highest level in the three level architecture and closest to the user. It is also
known as the view level.
 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.

Database Management System (DMS)


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.

Database Management System (DMS)


Data Abstraction ::
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.

Database Management System (DMS)


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.
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.

Database Management System (DMS)


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:
Physical Data Independence

Logical Data Independence

Database Management System (DMS)


Physical Data Independence
 Physical Data Independence is the ability to modify the
physical schema without requiring any change in application programs.
 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.
 Physical data independence separates conceptual levels from the
internal levels.
Logical Data Independence
 Logical data independence is ability to modify the conceptual schema
without requiring any change in application programs.
 Modification at the logical levels are necessary whenever the logical
structures of the database is altered.
 Logical data independence separates external level from the
conceptual view.
 it is difficult to achieve logical data independence.

Database Management System (DMS)


Topic :- 4 : Outlines
Overall structure of DBMS.

Database Management System (DMS)


Overall structure of DBMS ::

Database Management System (DMS)


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

Database Management System (DMS)


1. Database Users:
Users are differentiated by the way they expect to interact with the system:
Application programmers:
◦ Application programmers are computer professionals who write application programs.
Application programmers can choose from many tools to develop user interfaces.
◦ 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 interact with the system without writing programs. Instead, they
form their requests in a database query language.
◦ 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 :
◦ Specialized users are sophisticated users who write specialized database applications
that do not fit into the traditional data-processing framework.
◦ 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.

Database Management System (DMS)


1. Database Users:
Naïve users :
◦ Naive users are unsophisticated users who interact with the system by invoking one of
the application programs that have been written previously.
◦ 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 Management System (DMS)


1. Database Users:
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:
◦ Schema definition: The DBA creates the original database schema by executing a set of
data definition statements in the DDL.
◦ Storage structure and access method definition.
◦ 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.
◦ 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.
◦ Specifying integrity constraints.
◦ Monitoring performance and responding to changes in requirements.

Database Management System (DMS)


2. Query Processor Components :
• 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.

• 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.

• DDL Interpreter : It interprets the DDL statements and records them in a set of
tables containing meta data or data dictionary.

• Query Evaluation Engine : It executes low-level instructions generated by the


DML compiler.

Database Management System (DMS)


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.

• Authorization and Integrity Manager : It tests for the satisfaction of integrity


constraints checks the authority of users to access data.

• Transaction Manager : It ensures that the database remains in a consistent


state despite the system failures and that concurrent transaction execution
proceeds without conflicting.

• File Manager : It manages the allocation of space on disk storage and the data
structures used to represent information stored on disk.

• Buffer Manager : It is responsible for fetching data from disk storage into main
memory and deciding what data to cache in memory.

Database Management System (DMS)


4. Data Structures :
Following data structures are required as a part of the physical system
implementation.

• Data Files : It stores the database.

• Data Dictionary : It stores meta data (data about data) about the structure of
the database.

• Indices : Provide fast access to data items that hold particular values.

• 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.

Database Management System (DMS)


Topic:- 5 : Outlines
Data Modeling: record based logical model
Relational,
Network,
Hierarchical..

Database Management System (DMS)


Data Model:
“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

Database Management System (DMS)


Record based model:
A record based data model is used to specify the overall logical structure of the
database.

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.

Database Management System (DMS)


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.

Database Management System (DMS)


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.

Database Management System (DMS)


Entity Relationship Models:
The E-R model views the real world as a set of basic objects( entities) and
relationship among these objects.
An Entity–relationship model (ER model) describes the structure of a database
with the help of a diagram, which is known as Entity Relationship Diagram (ER
Diagram). An ER model is a design or blueprint of a database that can later be
implemented as a database.
E-R model Basics
Entity
Entity set
Attributes
Relationship

Database Management System (DMS)


Entity Relationship Models :
Components, Symbols, And Notations:

Database Management System (DMS)


Entity :
An entity is an object that exists and is distinguishable from
other objects.
Example: specific person, company, event, plant

Entity Set:
An entity set is a set of entities of the same type that share the
same properties.
Example: set of all persons, companies, trees, holidays

Database Management System (DMS)


Strong entity set :
An entity set that has sufficient attributes to form a primary key is
called as Strong entity set..
Example: Employee is a Strong entity with attributes as empid,
name, address, salary, birthdate among which empid can be
considered as primary key.

Weak entity set:


The entity set which does not have sufficient attributes to form a
primary key is called as Weak entity set.
A weak entity is an entity that cannot be uniquely identified by its
attributes alone; therefore, it must use a foreign key in conjunction
with its attributes to create a primary key. The foreign key is
typically a primary key of an entity it is related to.

Database Management System (DMS)


Weak entity set:
Example: Employee has "dependents" with name, birthdate, and
relationship to employee and it can be related to employee with
the help of empid, so "dependents" is a weak entity which depends
on strong entity "Employee".

Database Management System (DMS)


Attribute:
An attribute describes the property of an entity. An attribute is
represented as Oval in an ER diagram.
Example: Roll_No, Name, DOB, Age, Address, Mobile_No are the
attributes which defines entity type Student.

Database Management System (DMS)


1. Simple Attributes:
Simple attributes are those attributes which can not be divided
further..
Example: Roll_No, Class, Age, in student entity are the simple
attributes which can not be divided further.

Database Management System (DMS)


2. Composite Attributes-
Composite attributes are those attributes which are composed of
many other simple attributes.
Example: Attributes “Name” and “Address” are composite
attributes as they are composed of many other simple attributes.

Database Management System (DMS)


3. Single Valued Attributes-
Single valued attributes are those attributes which can take only
one value for a given entity from an entity set.
Example: all the attributes are single valued attributes as they can
take only one specific value for each entity.

Database Management System (DMS)


4. Multi Valued Attributes-
Multi valued attributes are those attributes which can take more
than one value for a given entity from an entity set.

Example: attributes “Mob_no” and “Email_id” are multi valued


attributes as they can take more than one values for a given entity.

Database Management System (DMS)


5. Derived Attributes-
Derived attributes are those attributes which can be derived from
other attribute(s).

Example: attribute “Age” is a derived attribute as it can be derived


from the attribute “DOB”.

Database Management System (DMS)


6. Key Attributes-
Key attributes are those attributes which can identify an entity
uniquely in an entity set.
Example: attribute “Roll_no” is a key attribute as it can identify any
student uniquely.

Database Management System (DMS)


Relationship
A relationship is used to describe the relation between entities.
Diamond or rhombus is used to represent the relationship.

A relationship is represented by diamond shape in ER diagram, it


shows the relationship among entities.
There are four types of relationships:
1. One to One
2. One to Many
3. Many to One
4. Many to Many

Database Management System (DMS)


1. One-to-One Relationship
When only one instance of an entity is associated with the
relationship, then it is known as one to one relationship.
Example:- A female can marry to one male, and a male can marry to
one female.

2. One-to-many relationship
When only one instance of the entity on the left, and more than one
instance of an entity on the right associates with the relationship then
this is known as a one-to-many relationship.
Example:- Scientist can invent many inventions, but the invention is
done by the only specific scientist.

Database Management System (DMS)


3. Many-to-one relationship-
When more than one instance of the entity on the left, and only
one instance of an entity on the right associates with the
relationship then it is known as a many-to-one relationship.
Example:- Student enrolls for only one course, but a course can
have many students.

4. Many-to-many relationship-
When more than one instance of the entity on the left, and more than
one instance of an entity on the right associates with the relationship
then it is known as a many-to-many relationship.
Example:- Employee can assign by many projects and project can have
many employees.

Database Management System (DMS)


Example: Draw an E-R diagram of library management system considering issue and return,
Fine calculation facility. Consider appropriate entities..

Database Management System (DMS)


Example: Draw an ER diagram, LECTURE, STUDENT, SUBJECT and COURSE forms
individual tables.

Database Management System (DMS)


Thanks

Database Management System (DMS)

You might also like