SlideShare a Scribd company logo
1 of 31
Download to read offline
Presented By:
Ravinder Kamboj
Objective
 Objective of this lecture is to make students be able to
understand the basic concepts of database.
 To introduce the problems with traditional file system
and advantages of database over file system.
Index
 What is DBMS?
 Traditional method of data storage
 Characteristics of file system
 Problems with Traditional approach
 What is database and DBMS?
 Advantages of DBMS
 Difference between file system and database
Database Management System (DBMS)
 DBMS A database management system is the software system that
allows users to define, create and maintain a database and provides
controlled access to the data.
 A database management system (DBMS) is basically a collection of
programs that enables users to store, modify, and extract information
from a database as per the requirements.
 DBMS is an intermediate layer between programs and the data.
Programs access the DBMS, which then accesses the data.
 The following are main examples of database applications:
 Banking System
 College Management System
 Inventory Control System
 Hospital Management
 Airlines
 Telecommunication
 HRM
Traditional Methods
 File System:
 File system was an early attempt to computerize the
manual filing system.
 A file system is a method for storing and organizing
computer files and the data to make it easy to find and
access.
 File Systems may use a storage device such as a hard disk
or CD-ROM.
Characteristics of File Processing System
 It is group of files storing data of an organization.
 Each file is independent from one another.
 Each file is called flat file.
 Each file contained and processed information for one
specific function like accounting or inventory.
 Files are designed by using application programs written
in programming languages such as COBOL, C, C++, etc….
Flat file
 A flat file is a file containing records that have no
structured interrelationship
Traditional Method of Data Storage
Problems: Traditional approach
 Data Redundancy
 Data Isolation
 Program/ Data Dependence
 Atomicity Problems
 Concurrent Access Anomalies
 Data Security
Data Redundancy
 Often the same information is duplicated in two or
more files.
 It may lead to inconsistency
 Assume the same data is repeated in two or more files.
If change is made to data in one file, it is required that
change be made to the data in the other file as well.
 If this is not done, it will lead to multiple different
values for same data field.
Data Isolation
 Data isolation means that all the related data is not
available in one file.
 Generally, the data scattered in various files, and the
files may be in different formats, therefore writing new
application programs to retrieve the appropriate data
is difficult.
Program/ Data Dependence
 Assume in a banking system there is need to find out
the names of all customers who live within a particular
postal-code area.
 But there is only a program to generate the list of all
customers.
 The bank officer has now two choices: either obtain
the list of all customers and extract the needed
information manually or ask a system programmer to
write the necessary application program.
 Both the alternatives are obviously unsatisfactory.
Atomicity Problems
 If a failure occurs, the data to be restored to the consistent
state.
 Example:
 A program transfers Rs 200 from account A to account B.
 If a system failure occurs during execution of program.
 It is possible that Rs 200 debited from account A but not
credited to B.
 It is essential to database consistency that either both the
credit and debit occur, or neither occur.
 Funds transfer must be atomic, it must happen in its entirety
or not at all.
 It is difficulty to ensure atomicity in traditional file systems.
Concurrent Access Anomalies
 Many systems allow multiple users to update the data
simultaneously. In such environment, interaction of
concurrent updates may result in inconsistent data.
 Example: Bank account A containing Rs. 6000/-. If two
transactions of withdraw funds( Rs 500/- and Rs 1000/-
respectively) from account about same time, result of the
concurrent executions may leave the account in an
incorrect state.
 Program on the behalf of each withdrawal read the old
balance, reduce amount and write result back.
 If both two programs are concurrent they both may read
the value Rs 6000/-.
 Depending on which one writes the value last, the account
may contain either Rs 5500/- or Rs 5000/-, rather than the
correct value of Rs 4500/-
Data Security
 The data as maintained in flat files is easily accessible
and therefore not secure.
 Example: the Customer_Transaction file has details
about the total available balance of all customers.
 A customer wants information about his/her account
balance.
 In a file system it is difficult to give the customer access
to only his/her data in the file.
 Thus enforcing security constraints for entire file or for
certain data items are difficult.
What is the solution?
Database Approach
 In order to remove all the above limitations of the File
Based Approach, a new approach was required that
must be more effective known as Database approach.
 A database is a computer based record keeping system
whose over all purpose is to record and maintain
information.
 The database is a single, large repository of data, which
can be used simultaneously by many departments and
users.
Where does the DBMS fit?
Programming Languages
4GL ( Database Query
Languages, Data
Manipulation, analysis and
Reporting Languages)
High-Level Languages
Assembly Language
Machine Language
Difference Between File and DBMS Operations
Advantages of DBMS
 Controlling redundancy
 Enforces integrity constraints
 Better security
 Better flexibility
 Effective data sharing
 Enables backup and recovery
Controlling Redundancy
 Redundant Data
Non-Redundant Database
 In case of centralized database, data can be shared
by number of applications and whole college can
maintain its data with the following database:
Every application can access the information of other’s by
joining on the basis of column ( Rollno )
Enforcing Integrity Constraints
 Integrity of data means that data in database is always accurate.
 Integrity constraints are enforced on database.
 Example: Let us consider the case of college database and
suppose that college having only Btech, Mtech, MCA, MSc, BCA,
BBA and Bcom. But if a user enters the class MS, then incorrect
information must not be stored in database and must be
prompted that this is an invalid entry. Integrity is to be enforced
on class attribute.
 In file system this constraint must be enforced an all the
application separately.
 In case of DBMS this integrity constraint is applied only once on
the class field of the General Office.
How to enforce integrity?
 Integrity rules:
 Entity Integrity rule: Primary key value should not be
null (Mandatory field)
 Referential Integrity: The values of foreign key should
match the primary key in parent table.
Solution to concurrency Anomaly
S (Shared Lock) X (Exclusive Lock)
S true false
X false True
Locks
T1
• Lock-X(B);
• Read(B,b);
• b:=b-50;
• Write(B,b);
• Unlock(B);
• Lock-X(A);
• Read(A,a);
• a:=a+50;
• Write(A,a)
• Unlock(A);
T2
• Lock-S(A);
• Read(A,a);
• Unlock(A);
• Lock-S(B)
• Read(B,b);
• Unlock(B);
• Display(a+b);
Schedule 1
T1
• Lock-X(B);
• Read(B,b);
• b:=b-50;
• Write(B,b)
• Unlock(B)
• Lock-X(A)
• Read(A,a)
• a:=a+50;
• Write(A,a)
• Unlock(A);
T2
• Lock-S(A);
• Read(A,a);
• Unlock(A);
• Lock-S(B)
• Read(B,b);
• Unlock(B);
• Display(a+b);
Concurrency-control manager
• Grant-X(B,T1)
• Grant-S(A,T2)
• Grant-S(B,T2)
• Grant-X(A,T2)
Difference between file system and DBMS
Thank You

More Related Content

What's hot (20)

Architecture of dbms(lecture 3)
Architecture of dbms(lecture 3)Architecture of dbms(lecture 3)
Architecture of dbms(lecture 3)
 
Normalization in DBMS
Normalization in DBMSNormalization in DBMS
Normalization in DBMS
 
Enterprise application integration
Enterprise application integrationEnterprise application integration
Enterprise application integration
 
Normal forms
Normal formsNormal forms
Normal forms
 
Advance database systems (part 1)
Advance database systems (part 1)Advance database systems (part 1)
Advance database systems (part 1)
 
Topic 3.2 internet service provider
Topic 3.2 internet service providerTopic 3.2 internet service provider
Topic 3.2 internet service provider
 
Anomalies in database
Anomalies in databaseAnomalies in database
Anomalies in database
 
Database anomalies
Database anomaliesDatabase anomalies
Database anomalies
 
Lecture 1 ddbms
Lecture 1 ddbmsLecture 1 ddbms
Lecture 1 ddbms
 
Internet as the network infrastructure
Internet as the  network infrastructureInternet as the  network infrastructure
Internet as the network infrastructure
 
Adbms 17 object query language
Adbms 17 object query languageAdbms 17 object query language
Adbms 17 object query language
 
Database - Design & Implementation - 1
Database - Design & Implementation - 1Database - Design & Implementation - 1
Database - Design & Implementation - 1
 
Network protocol
Network protocolNetwork protocol
Network protocol
 
CS8091_BDA_Unit_I_Analytical_Architecture
CS8091_BDA_Unit_I_Analytical_ArchitectureCS8091_BDA_Unit_I_Analytical_Architecture
CS8091_BDA_Unit_I_Analytical_Architecture
 
Databases: Normalisation
Databases: NormalisationDatabases: Normalisation
Databases: Normalisation
 
Chapter12 designing databases
Chapter12 designing databasesChapter12 designing databases
Chapter12 designing databases
 
object oriented methodologies
object oriented methodologiesobject oriented methodologies
object oriented methodologies
 
Oracle
OracleOracle
Oracle
 
TCP/IP Network ppt
TCP/IP Network pptTCP/IP Network ppt
TCP/IP Network ppt
 
Distributed Systems
Distributed SystemsDistributed Systems
Distributed Systems
 

Viewers also liked

Normalization of Data Base
Normalization of Data BaseNormalization of Data Base
Normalization of Data BaseRavinder Kamboj
 
Cost estimation for Query Optimization
Cost estimation for Query OptimizationCost estimation for Query Optimization
Cost estimation for Query OptimizationRavinder Kamboj
 
Query decomposition in data base
Query decomposition in data baseQuery decomposition in data base
Query decomposition in data baseSalman Memon
 
Query processing and optimization (updated)
Query processing and optimization (updated)Query processing and optimization (updated)
Query processing and optimization (updated)Ravinder Kamboj
 

Viewers also liked (6)

Query processing
Query processingQuery processing
Query processing
 
Normalization of Data Base
Normalization of Data BaseNormalization of Data Base
Normalization of Data Base
 
Cost estimation for Query Optimization
Cost estimation for Query OptimizationCost estimation for Query Optimization
Cost estimation for Query Optimization
 
Sql fundamentals
Sql fundamentalsSql fundamentals
Sql fundamentals
 
Query decomposition in data base
Query decomposition in data baseQuery decomposition in data base
Query decomposition in data base
 
Query processing and optimization (updated)
Query processing and optimization (updated)Query processing and optimization (updated)
Query processing and optimization (updated)
 

Similar to Lecture 1&2(rdbms-ii)

Similar to Lecture 1&2(rdbms-ii) (20)

Ch01
Ch01Ch01
Ch01
 
Dbms mca-section a
Dbms mca-section aDbms mca-section a
Dbms mca-section a
 
1. Chapter One.pdf
1. Chapter One.pdf1. Chapter One.pdf
1. Chapter One.pdf
 
ms-11.pdf
ms-11.pdfms-11.pdf
ms-11.pdf
 
Unit3rd
Unit3rdUnit3rd
Unit3rd
 
database ppt(2)
database ppt(2)database ppt(2)
database ppt(2)
 
Relational database management systems
Relational database management systemsRelational database management systems
Relational database management systems
 
DBMS-1.pptx
DBMS-1.pptxDBMS-1.pptx
DBMS-1.pptx
 
Fundamentals of DBMS
Fundamentals of DBMSFundamentals of DBMS
Fundamentals of DBMS
 
Advantages of database management system
Advantages of database management system Advantages of database management system
Advantages of database management system
 
Dbms unit01
Dbms unit01Dbms unit01
Dbms unit01
 
Unit1 dbms
Unit1 dbmsUnit1 dbms
Unit1 dbms
 
Database Concepts
Database ConceptsDatabase Concepts
Database Concepts
 
Database, Lecture-1.ppt
Database, Lecture-1.pptDatabase, Lecture-1.ppt
Database, Lecture-1.ppt
 
Database System Concepts
Database System ConceptsDatabase System Concepts
Database System Concepts
 
chapter 1-Introduction Fundamentals of database system.pdf
chapter 1-Introduction Fundamentals of database system.pdfchapter 1-Introduction Fundamentals of database system.pdf
chapter 1-Introduction Fundamentals of database system.pdf
 
Introduction to Database
Introduction to DatabaseIntroduction to Database
Introduction to Database
 
database introductoin optimization1-app6891.pdf
database introductoin optimization1-app6891.pdfdatabase introductoin optimization1-app6891.pdf
database introductoin optimization1-app6891.pdf
 
Dbms
DbmsDbms
Dbms
 
DBMS unit 1
DBMS unit 1DBMS unit 1
DBMS unit 1
 

More from Ravinder Kamboj

More from Ravinder Kamboj (8)

Data warehouse,data mining & Big Data
Data warehouse,data mining & Big DataData warehouse,data mining & Big Data
Data warehouse,data mining & Big Data
 
DDBMS
DDBMSDDBMS
DDBMS
 
Java script
Java scriptJava script
Java script
 
File Management
File ManagementFile Management
File Management
 
HTML Forms
HTML FormsHTML Forms
HTML Forms
 
DHTML
DHTMLDHTML
DHTML
 
CSA lecture-1
CSA lecture-1CSA lecture-1
CSA lecture-1
 
Relational database management system (rdbms) i
Relational database management system (rdbms) iRelational database management system (rdbms) i
Relational database management system (rdbms) i
 

Recently uploaded

How to Manage Buy 3 Get 1 Free in Odoo 17
How to Manage Buy 3 Get 1 Free in Odoo 17How to Manage Buy 3 Get 1 Free in Odoo 17
How to Manage Buy 3 Get 1 Free in Odoo 17Celine George
 
The Emergence of Legislative Behavior in the Colombian Congress
The Emergence of Legislative Behavior in the Colombian CongressThe Emergence of Legislative Behavior in the Colombian Congress
The Emergence of Legislative Behavior in the Colombian CongressMaria Paula Aroca
 
Transdisciplinary Pathways for Urban Resilience [Work in Progress].pptx
Transdisciplinary Pathways for Urban Resilience [Work in Progress].pptxTransdisciplinary Pathways for Urban Resilience [Work in Progress].pptx
Transdisciplinary Pathways for Urban Resilience [Work in Progress].pptxinfo924062
 
Farrington HS Streamlines Guest Entrance
Farrington HS Streamlines Guest EntranceFarrington HS Streamlines Guest Entrance
Farrington HS Streamlines Guest Entrancejulius27264
 
31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...
31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...
31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...Nguyen Thanh Tu Collection
 
Sarah Lahm In Media Res Media Component
Sarah Lahm  In Media Res Media ComponentSarah Lahm  In Media Res Media Component
Sarah Lahm In Media Res Media ComponentInMediaRes1
 
MS4 level being good citizen -imperative- (1) (1).pdf
MS4 level   being good citizen -imperative- (1) (1).pdfMS4 level   being good citizen -imperative- (1) (1).pdf
MS4 level being good citizen -imperative- (1) (1).pdfMr Bounab Samir
 
Indexing Structures in Database Management system.pdf
Indexing Structures in Database Management system.pdfIndexing Structures in Database Management system.pdf
Indexing Structures in Database Management system.pdfChristalin Nelson
 
How to Uninstall a Module in Odoo 17 Using Command Line
How to Uninstall a Module in Odoo 17 Using Command LineHow to Uninstall a Module in Odoo 17 Using Command Line
How to Uninstall a Module in Odoo 17 Using Command LineCeline George
 
Jason Potel In Media Res Media Component
Jason Potel In Media Res Media ComponentJason Potel In Media Res Media Component
Jason Potel In Media Res Media ComponentInMediaRes1
 
Employablity presentation and Future Career Plan.pptx
Employablity presentation and Future Career Plan.pptxEmployablity presentation and Future Career Plan.pptx
Employablity presentation and Future Career Plan.pptxryandux83rd
 
BÀI TẬP BỔ TRỢ 4 KĨ NĂNG TIẾNG ANH LỚP 8 - CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC ...
BÀI TẬP BỔ TRỢ 4 KĨ NĂNG TIẾNG ANH LỚP 8 - CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC ...BÀI TẬP BỔ TRỢ 4 KĨ NĂNG TIẾNG ANH LỚP 8 - CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC ...
BÀI TẬP BỔ TRỢ 4 KĨ NĂNG TIẾNG ANH LỚP 8 - CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC ...Nguyen Thanh Tu Collection
 
Tree View Decoration Attribute in the Odoo 17
Tree View Decoration Attribute in the Odoo 17Tree View Decoration Attribute in the Odoo 17
Tree View Decoration Attribute in the Odoo 17Celine George
 
CLASSIFICATION OF ANTI - CANCER DRUGS.pptx
CLASSIFICATION OF ANTI - CANCER DRUGS.pptxCLASSIFICATION OF ANTI - CANCER DRUGS.pptx
CLASSIFICATION OF ANTI - CANCER DRUGS.pptxAnupam32727
 
BÀI TẬP BỔ TRỢ TIẾNG ANH 11 THEO ĐƠN VỊ BÀI HỌC - CẢ NĂM - CÓ FILE NGHE (GLOB...
BÀI TẬP BỔ TRỢ TIẾNG ANH 11 THEO ĐƠN VỊ BÀI HỌC - CẢ NĂM - CÓ FILE NGHE (GLOB...BÀI TẬP BỔ TRỢ TIẾNG ANH 11 THEO ĐƠN VỊ BÀI HỌC - CẢ NĂM - CÓ FILE NGHE (GLOB...
BÀI TẬP BỔ TRỢ TIẾNG ANH 11 THEO ĐƠN VỊ BÀI HỌC - CẢ NĂM - CÓ FILE NGHE (GLOB...Nguyen Thanh Tu Collection
 
6 ways Samsung’s Interactive Display powered by Android changes the classroom
6 ways Samsung’s Interactive Display powered by Android changes the classroom6 ways Samsung’s Interactive Display powered by Android changes the classroom
6 ways Samsung’s Interactive Display powered by Android changes the classroomSamsung Business USA
 
Shark introduction Morphology and its behaviour characteristics
Shark introduction Morphology and its behaviour characteristicsShark introduction Morphology and its behaviour characteristics
Shark introduction Morphology and its behaviour characteristicsArubSultan
 

Recently uploaded (20)

How to Manage Buy 3 Get 1 Free in Odoo 17
How to Manage Buy 3 Get 1 Free in Odoo 17How to Manage Buy 3 Get 1 Free in Odoo 17
How to Manage Buy 3 Get 1 Free in Odoo 17
 
The Emergence of Legislative Behavior in the Colombian Congress
The Emergence of Legislative Behavior in the Colombian CongressThe Emergence of Legislative Behavior in the Colombian Congress
The Emergence of Legislative Behavior in the Colombian Congress
 
Transdisciplinary Pathways for Urban Resilience [Work in Progress].pptx
Transdisciplinary Pathways for Urban Resilience [Work in Progress].pptxTransdisciplinary Pathways for Urban Resilience [Work in Progress].pptx
Transdisciplinary Pathways for Urban Resilience [Work in Progress].pptx
 
Israel Genealogy Research Assoc. April 2024 Database Release
Israel Genealogy Research Assoc. April 2024 Database ReleaseIsrael Genealogy Research Assoc. April 2024 Database Release
Israel Genealogy Research Assoc. April 2024 Database Release
 
Farrington HS Streamlines Guest Entrance
Farrington HS Streamlines Guest EntranceFarrington HS Streamlines Guest Entrance
Farrington HS Streamlines Guest Entrance
 
31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...
31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...
31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...
 
Sarah Lahm In Media Res Media Component
Sarah Lahm  In Media Res Media ComponentSarah Lahm  In Media Res Media Component
Sarah Lahm In Media Res Media Component
 
MS4 level being good citizen -imperative- (1) (1).pdf
MS4 level   being good citizen -imperative- (1) (1).pdfMS4 level   being good citizen -imperative- (1) (1).pdf
MS4 level being good citizen -imperative- (1) (1).pdf
 
Indexing Structures in Database Management system.pdf
Indexing Structures in Database Management system.pdfIndexing Structures in Database Management system.pdf
Indexing Structures in Database Management system.pdf
 
How to Uninstall a Module in Odoo 17 Using Command Line
How to Uninstall a Module in Odoo 17 Using Command LineHow to Uninstall a Module in Odoo 17 Using Command Line
How to Uninstall a Module in Odoo 17 Using Command Line
 
Jason Potel In Media Res Media Component
Jason Potel In Media Res Media ComponentJason Potel In Media Res Media Component
Jason Potel In Media Res Media Component
 
Employablity presentation and Future Career Plan.pptx
Employablity presentation and Future Career Plan.pptxEmployablity presentation and Future Career Plan.pptx
Employablity presentation and Future Career Plan.pptx
 
BÀI TẬP BỔ TRỢ 4 KĨ NĂNG TIẾNG ANH LỚP 8 - CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC ...
BÀI TẬP BỔ TRỢ 4 KĨ NĂNG TIẾNG ANH LỚP 8 - CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC ...BÀI TẬP BỔ TRỢ 4 KĨ NĂNG TIẾNG ANH LỚP 8 - CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC ...
BÀI TẬP BỔ TRỢ 4 KĨ NĂNG TIẾNG ANH LỚP 8 - CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC ...
 
Tree View Decoration Attribute in the Odoo 17
Tree View Decoration Attribute in the Odoo 17Tree View Decoration Attribute in the Odoo 17
Tree View Decoration Attribute in the Odoo 17
 
CLASSIFICATION OF ANTI - CANCER DRUGS.pptx
CLASSIFICATION OF ANTI - CANCER DRUGS.pptxCLASSIFICATION OF ANTI - CANCER DRUGS.pptx
CLASSIFICATION OF ANTI - CANCER DRUGS.pptx
 
Plagiarism,forms,understand about plagiarism,avoid plagiarism,key significanc...
Plagiarism,forms,understand about plagiarism,avoid plagiarism,key significanc...Plagiarism,forms,understand about plagiarism,avoid plagiarism,key significanc...
Plagiarism,forms,understand about plagiarism,avoid plagiarism,key significanc...
 
BÀI TẬP BỔ TRỢ TIẾNG ANH 11 THEO ĐƠN VỊ BÀI HỌC - CẢ NĂM - CÓ FILE NGHE (GLOB...
BÀI TẬP BỔ TRỢ TIẾNG ANH 11 THEO ĐƠN VỊ BÀI HỌC - CẢ NĂM - CÓ FILE NGHE (GLOB...BÀI TẬP BỔ TRỢ TIẾNG ANH 11 THEO ĐƠN VỊ BÀI HỌC - CẢ NĂM - CÓ FILE NGHE (GLOB...
BÀI TẬP BỔ TRỢ TIẾNG ANH 11 THEO ĐƠN VỊ BÀI HỌC - CẢ NĂM - CÓ FILE NGHE (GLOB...
 
CARNAVAL COM MAGIA E EUFORIA _
CARNAVAL COM MAGIA E EUFORIA            _CARNAVAL COM MAGIA E EUFORIA            _
CARNAVAL COM MAGIA E EUFORIA _
 
6 ways Samsung’s Interactive Display powered by Android changes the classroom
6 ways Samsung’s Interactive Display powered by Android changes the classroom6 ways Samsung’s Interactive Display powered by Android changes the classroom
6 ways Samsung’s Interactive Display powered by Android changes the classroom
 
Shark introduction Morphology and its behaviour characteristics
Shark introduction Morphology and its behaviour characteristicsShark introduction Morphology and its behaviour characteristics
Shark introduction Morphology and its behaviour characteristics
 

Lecture 1&2(rdbms-ii)

  • 2. Objective  Objective of this lecture is to make students be able to understand the basic concepts of database.  To introduce the problems with traditional file system and advantages of database over file system.
  • 3. Index  What is DBMS?  Traditional method of data storage  Characteristics of file system  Problems with Traditional approach  What is database and DBMS?  Advantages of DBMS  Difference between file system and database
  • 4. Database Management System (DBMS)  DBMS A database management system is the software system that allows users to define, create and maintain a database and provides controlled access to the data.  A database management system (DBMS) is basically a collection of programs that enables users to store, modify, and extract information from a database as per the requirements.  DBMS is an intermediate layer between programs and the data. Programs access the DBMS, which then accesses the data.  The following are main examples of database applications:  Banking System  College Management System  Inventory Control System  Hospital Management  Airlines  Telecommunication  HRM
  • 5. Traditional Methods  File System:  File system was an early attempt to computerize the manual filing system.  A file system is a method for storing and organizing computer files and the data to make it easy to find and access.  File Systems may use a storage device such as a hard disk or CD-ROM.
  • 6. Characteristics of File Processing System  It is group of files storing data of an organization.  Each file is independent from one another.  Each file is called flat file.  Each file contained and processed information for one specific function like accounting or inventory.  Files are designed by using application programs written in programming languages such as COBOL, C, C++, etc….
  • 7. Flat file  A flat file is a file containing records that have no structured interrelationship
  • 8. Traditional Method of Data Storage
  • 9. Problems: Traditional approach  Data Redundancy  Data Isolation  Program/ Data Dependence  Atomicity Problems  Concurrent Access Anomalies  Data Security
  • 10. Data Redundancy  Often the same information is duplicated in two or more files.  It may lead to inconsistency  Assume the same data is repeated in two or more files. If change is made to data in one file, it is required that change be made to the data in the other file as well.  If this is not done, it will lead to multiple different values for same data field.
  • 11.
  • 12. Data Isolation  Data isolation means that all the related data is not available in one file.  Generally, the data scattered in various files, and the files may be in different formats, therefore writing new application programs to retrieve the appropriate data is difficult.
  • 13. Program/ Data Dependence  Assume in a banking system there is need to find out the names of all customers who live within a particular postal-code area.  But there is only a program to generate the list of all customers.  The bank officer has now two choices: either obtain the list of all customers and extract the needed information manually or ask a system programmer to write the necessary application program.  Both the alternatives are obviously unsatisfactory.
  • 14. Atomicity Problems  If a failure occurs, the data to be restored to the consistent state.  Example:  A program transfers Rs 200 from account A to account B.  If a system failure occurs during execution of program.  It is possible that Rs 200 debited from account A but not credited to B.  It is essential to database consistency that either both the credit and debit occur, or neither occur.  Funds transfer must be atomic, it must happen in its entirety or not at all.  It is difficulty to ensure atomicity in traditional file systems.
  • 15. Concurrent Access Anomalies  Many systems allow multiple users to update the data simultaneously. In such environment, interaction of concurrent updates may result in inconsistent data.  Example: Bank account A containing Rs. 6000/-. If two transactions of withdraw funds( Rs 500/- and Rs 1000/- respectively) from account about same time, result of the concurrent executions may leave the account in an incorrect state.  Program on the behalf of each withdrawal read the old balance, reduce amount and write result back.  If both two programs are concurrent they both may read the value Rs 6000/-.  Depending on which one writes the value last, the account may contain either Rs 5500/- or Rs 5000/-, rather than the correct value of Rs 4500/-
  • 16. Data Security  The data as maintained in flat files is easily accessible and therefore not secure.  Example: the Customer_Transaction file has details about the total available balance of all customers.  A customer wants information about his/her account balance.  In a file system it is difficult to give the customer access to only his/her data in the file.  Thus enforcing security constraints for entire file or for certain data items are difficult.
  • 17. What is the solution?
  • 18. Database Approach  In order to remove all the above limitations of the File Based Approach, a new approach was required that must be more effective known as Database approach.  A database is a computer based record keeping system whose over all purpose is to record and maintain information.  The database is a single, large repository of data, which can be used simultaneously by many departments and users.
  • 19. Where does the DBMS fit?
  • 20. Programming Languages 4GL ( Database Query Languages, Data Manipulation, analysis and Reporting Languages) High-Level Languages Assembly Language Machine Language
  • 21. Difference Between File and DBMS Operations
  • 22. Advantages of DBMS  Controlling redundancy  Enforces integrity constraints  Better security  Better flexibility  Effective data sharing  Enables backup and recovery
  • 24. Non-Redundant Database  In case of centralized database, data can be shared by number of applications and whole college can maintain its data with the following database: Every application can access the information of other’s by joining on the basis of column ( Rollno )
  • 25. Enforcing Integrity Constraints  Integrity of data means that data in database is always accurate.  Integrity constraints are enforced on database.  Example: Let us consider the case of college database and suppose that college having only Btech, Mtech, MCA, MSc, BCA, BBA and Bcom. But if a user enters the class MS, then incorrect information must not be stored in database and must be prompted that this is an invalid entry. Integrity is to be enforced on class attribute.  In file system this constraint must be enforced an all the application separately.  In case of DBMS this integrity constraint is applied only once on the class field of the General Office.
  • 26. How to enforce integrity?  Integrity rules:  Entity Integrity rule: Primary key value should not be null (Mandatory field)  Referential Integrity: The values of foreign key should match the primary key in parent table.
  • 27. Solution to concurrency Anomaly S (Shared Lock) X (Exclusive Lock) S true false X false True
  • 28. Locks T1 • Lock-X(B); • Read(B,b); • b:=b-50; • Write(B,b); • Unlock(B); • Lock-X(A); • Read(A,a); • a:=a+50; • Write(A,a) • Unlock(A); T2 • Lock-S(A); • Read(A,a); • Unlock(A); • Lock-S(B) • Read(B,b); • Unlock(B); • Display(a+b);
  • 29. Schedule 1 T1 • Lock-X(B); • Read(B,b); • b:=b-50; • Write(B,b) • Unlock(B) • Lock-X(A) • Read(A,a) • a:=a+50; • Write(A,a) • Unlock(A); T2 • Lock-S(A); • Read(A,a); • Unlock(A); • Lock-S(B) • Read(B,b); • Unlock(B); • Display(a+b); Concurrency-control manager • Grant-X(B,T1) • Grant-S(A,T2) • Grant-S(B,T2) • Grant-X(A,T2)
  • 30. Difference between file system and DBMS