Co1 Session2

You might also like

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 33

DEPARTMENT OF CSE-H

DATA BASE MANAGEMENT SYSTEMS


22CS2110 RA

TOPIC
DBMS ARCHITECTURE
DATA INDEPENDENCE, LANGUAGES

SESSION-2
AIM OF THE SESSION

To familiarize students with the basic concept

 Three level architecture of DBMS, Data Independence and DBMS languages

INSTRUCTIONAL OBJECTIVES
This Session is designed to:

 DBMS Three-Level Architecture


 Data Independence
 Database Languages
LEARNING OUTCOMES
At the end of this session, you should be able to:

 Know the three level architecture of DBMS


 Know the Data Independence and different levels
 Different types of DBMS languages
SESSION INTRODUCTION

DBMS – Three Level Architecture


A database management system that provides three level of data is
said to follow three-level architecture .
External level (i.e. External Schema)
Conceptual level (i.e. Conceptual Schema)

Internal level (i.e. Internal Schema)

Data Independence
Data independence is the ability to modify the schema without effecting the
programs and the application to be rewritten.
SESSION INTRODUCTION

DBMS Languages

A DBMS has appropriate languages and interfaces to express database


queries and updates.
Database languages can be used to read, store and update the data in
the database.
DBMS Architecture
SESSION DESCRIPTION (Cont..)

External Level
• The external level is at the highest level of database abstraction . At this level, there
will be many views define for different users requirement. A view will describe only a
subset of the database. Any number of user views may exist for a given global or sub
schema.
• For example , each student has different view of the time table. The view of a student
of BTech (CSE) is different from the view of the student of BTech(ECE).Thus this
level of abstraction is concerned with different categories of users.
• Each external view is described by means of a schema called sub schema or external
schema.
SESSION DESCRIPTION (Cont..)

Conceptual Level
• At this level of database abstraction all the database entities and the
relationships among them are included . One conceptual view represents
the entire database . This conceptual view is defined by the conceptual
schema.
• The conceptual schema hides the details of physical storage structures and
concentrates on describing entities, data types, relationships, user operations
and constraints.
• It describes all the records and relationships included in the conceptual
view . There is only one conceptual schema per database . It includes
feature that specify the checks to relation data consistency and integrity.
SESSION DESCRIPTION (Cont..)
INTERNAL LEVEL

• It is the lowest level of abstraction closest to the physical storage


method used . It indicates how the data will be stored and describes
the data structures and access methods to be used by the database .
The internal view is expressed by internal schema.
• The following aspects are considered at this level:
• Storage allocation eg: B-tree, hashing.
• Access paths eg. specification of primary and secondary keys, indexes etc.
• Miscellaneous eg. Data compression and encryption techniques,
optimization of the internal structures.
SESSION DESCRIPTION (Cont..)
EXAMPLE FOR EACH LEVEL
SESSION DESCRIPTION (Cont..)

DATA INDEPENDENCE
• Data independence is the ability to modify the schema without effecting the
programs and the application to be rewritten.
• Data is separated from the programs, so that the changes made to the data
will not effect the program execution and the application.
• The main purpose of the three levels of data abstraction is to achieve
data independence. If the database changes and expands over time, it is
very important that the changes in one level should not effect the data at
other levels of the database. This would save time and cost required when
changing the database.
SESSION DESCRIPTION (Cont..)

LEVELS OF DATA INDEPENDENCE

• There are two levels of data independence based on


three levels of abstraction. These are as follows −
Physical Data Independence
Logical Data Independence
SESSION DESCRIPTION (Cont..)

Physical Data Independence


• Physical data independence is the ability to modify the physical
scheme without making it necessary to rewrite application programs.
Such modifications include changing from unblocked to blocked
record storage, or from sequential to random access files.
SESSION DESCRIPTION (Cont..)

Logical Data Independence

• Logical data independence is the ability to modify the conceptual


scheme without making it necessary to rewrite application programs.
Such a modification might be adding a field to a record; an application
program’s view hides this change from the program.
SESSION DESCRIPTION (Cont..)

DBMS Languages

• Data Definition Language (DDL)


• Data Manipulation Language (DML)
• Data Control Language(DCL)
• Transaction Control Language(TCL)
• Data Query Language(DQL)
SESSION DESCRIPTION (Cont..)

Data Definition Language

• Data Definition Language actually consists of the SQL


commands that can be used to define the database schema.
• It simply deals with descriptions of the database schema and
is used to create and modify the structure of database objects
in the database.
• DDL is a set of SQL commands used to create, modify, and
delete database structures but not data.
SESSION DESCRIPTION (Cont..)

Data Manipulation Language

• The SQL commands that deals with the manipulation of data


present in the database belong to DML or Data Manipulation
Language and this includes most of the SQL statements.
• It is the component of the SQL statement that controls access
to data and to the database.
SESSION DESCRIPTION (Cont..)

Data Manipulation Language

• The SQL commands that deals with the manipulation of data


present in the database belong to DML or Data Manipulation
Language and this includes most of the SQL statements.
• It is the component of the SQL statement that controls access
to data and to the database.
SESSION DESCRIPTION (Cont..)

Data Control Language


• DCL includes commands such as GRANT and REVOKE which
mainly deal with the rights, permissions, and other controls of the
database system.
• List of DCL commands:
• GRANT: This command gives users access privileges to the
database.
• REVOKE: This command withdraws the user’s access privileges
given by using the GRANT command.
SESSION DESCRIPTION (Cont..)

Transaction Control Language


• Transactions group a set of tasks into a single execution unit. Each transaction begins
with a specific task and ends when all the tasks in the group successfully complete.
• If any of the tasks fail, the transaction fails. Therefore, a transaction has only two results:
success or failure.
• The following TCL commands are used to control the execution of a transaction:
• COMMIT: Commits a Transaction.
• ROLLBACK: Rollbacks a transaction in case of any error occurs.
• SAVEPOINT: Sets a save point within a transaction.
SESSION DESCRIPTION (Cont..)

Data Query Language

• DQL is a portion of a SQL statement that allows you to get and organise
data from a database.
• Use the SELECT command to extract data from a database in order to
perform actions on it. It is the same as the projection operation in relational
algebra.
• The result of a select statement on a table or collection of tables is compiled
into a new temporary table, which is subsequently displayed or received by
a program, i.e. a front-end.
SESSION DESCRIPTION (Cont..)

DBMS Languages and Their Commands


SESSION DESCRIPTION (Cont..)

TOOLS

• Data dictionary / repository:


• Used to store schema descriptions and other information such as design
decisions, application program descriptions, user information, usage
standards, etc.
• Active data dictionary is accessed by DBMS software and users/DBA.
• Passive data dictionary is accessed by users/DBA only.
• Application Development Environments and CASE (computer-
aided software engineering) tools:
• Examples – Power builder (Sybase), Builder (Borland)
SESSION DESCRIPTION (Cont..)

TYPES OF DBMS
• Object Based Databases
• Hierarchical Databases
• Network Databases
• Relational Databases
SESSION DESCRIPTION (Cont..)

Object based Databases and Hierarchical Databases of DBMS

• Object based databases use concepts such as entities,


attributes, and relationships.
• Hierarchical Databases: Hierarchical Database model is one
of the oldest database models. Information Management
System (IMS) is based on this model
SESSION DESCRIPTION (Cont..)

Example for Hierarchical Databases


SESSION DESCRIPTION (Cont..)

Network Databases
• The Network Databases represents data with a graph. The main difference of the network model
from the hierarchical model, is its ability to handle many to many (N:N) relations
SESSION DESCRIPTION (Cont..)

Relational Databases
• Relational Databases stores data in the form of tables. This concept purposed by Dr. E.F. Codd, a
researcher of IBM in the year 1960 s
ACTIVITIES/ CASE STUDIES/ IMPORTANT FACTS RELATED TO
THE SESSION

Similar to a client-server architecture.


 Faster access, Easier to maintain and can handle multiple
users simultaneously.
Used when we wish to access DBMS via applications and
APIs.
Has scalability and security issues because of direct client-
server connection.
SUMMARY

The Database Management System (DBMS) architecture


shows how data in the database is viewed by the users. It is
not concerned about how the data are handled and
processed by the DBMS.
It helps in implementation, design, and maintenance of a
database to store and organize information for companies.
The concept of DBMS depends upon its architecture. The
architecture can be designed as centralized, decentralized,
or hierarchical.
SELF-ASSESSMENT QUESTIONS

1. Which is the lowest level of abstraction that describes how the data are actually stored?

(a) Physical
(b) Conceptual
(c) View
(d) User
Ans: a

2. The ______ can be used to explain data independence.

(a) One-schema architecture


(b) Two-schema architecture
(c) Three-schema architecture
(d) Four-schema architecture
Ans: c
SELF-ASSESSMENT QUESTIONS

3.Database languages can be used to ___________________ the data in the database.

(a) Read
(b) Store
(c) Update
(d) All of the above
ANS: d

4. What is TRUE about DDL?

(a) Database structure or patterns are defined by it.


(b) A schema, table, index, constraint, etc. are created in a database using it.
(c) A database skeleton can be created with DDL statements.
(d) All of the above
Ans: d
TERMINAL QUESTIONS

1. Describe the Three-level architecture of DBMS.

2. List out five responsibilities of a database management system. For each

responsibility, explain the problems that would arise if the responsibility were not

discharged.

3. Analyze the difference between physical and logical data independence.

4. List out the DBMS languages and explain the use of the languages.
REFERENCES FOR FURTHER LEARNING OF THE SESSION

Reference Books:
1. Database System Concepts, Sixth Edition, Abraham Silberschatz, Yale University Henry, F. Korth
Lehigh University, S. Sudarshan Indian Institute of Technology, Bombay.
2. Fundamentals of Database Systems, 7th Edition, RamezElmasri, University of Texas at Arlington,
Shamkant B. Navathe, University of Texas at Arlington.
Sites and Web links:
3. https://nptel.ac.in/courses/106105175
4. https://beginnersbook.com/2018/11/dbms-three-level-architecture/

You might also like