SlideShare a Scribd company logo
1 of 31
Introduction
Database Management Systems
What is a database?
 A very large, integrated collection of
data.
 Models real-world application :
– Entities (students, courses)
– Relationships (links,refrences)
 Usually data is too large to fit into main
memory, and often used by many users
Database applications ?
 E-commerce : Amazon.com, etc.
 Airlines and travel services
 Scientific data such as biology,
oceanography, etc.
 Spatial data such as maps, travel
networks,
 World Wide Web
 Digital libraries of artifacts of any kind
What is a DBMS ?
 DBMS stands for Database
Management System
 software package designed to store,
manage and provide access to
databases.
Why Study Databases??
 Shift from computation to information
 Datasets increasing in diversity and volume.
– Digital libraries, interactive video, Human Genome
project, EOS project
– ... need for DBMS exploding
 DBMS encompasses most of CS :
– OS, languages, theory, AI, multimedia, logic
?
Terminology : Data Models
 A data model :
– is a collection of concepts for describing data.
 A schema :
– is a description of a particular collection of data,
using the given data model.
 The relational model of data
– The most widely used model today.
– Main concept: relation, basically a table with rows
and columns.
– Every relation has a schema, which describes the
columns, or fields.
Data Definition Language (DDL)
 Specification notation for defining the
database schema
 DDL compiler generates a set of tables
stored in a data dictionary
 Data dictionary contains metadata (data
about data)
 Data storage and definition language –
special type of DDL in which the storage
structure and access methods used by the
database system are specified
Data Manipulation Language (DML)
 Language for accessing and
manipulating the data organized by the
appropriate data model
 Two classes of languages
– Procedural – user specifies what data is
required and how to get those data
– Nonprocedural – user specifies what data
is required without specifying how to get
those data
Database schema
 Its structure described in a formal
language supported by (DBMS) and
refers to the organization of data to
create a blueprint of how a database will
be constructed
DBMS Keys
 A key is an attribute also known as a
combination of attribute that is used to
identify records. Sometimes we might
have to retrieve data from more than
one table, in those cases we require to
join tables with the help of keys. The
purpose of the key is to bind data
together across tables without repeating
all of the data in every table.
Levels of Abstraction
 Many views:
– Views describe how users
see the data.
 Single conceptual (logical)
schema
– Conceptual schema defines
logical structure
 Single physical schema:
– Physical schema describes
the files and indexes used.
* Schemas are defined using Data Definition Language ;
* data is modified/queried using Data Manipulation Language
Physical Schema
Conceptual Schema
View 1 View 2 View 3
Example: University Database
 Conceptual schema:
– Students(sid: string, name: string, login: string,
age: integer, gpa:real)
– Courses(cid: string, cname:string, credits:integer)
– Enrolled(sid:string, cid:string, grade:string)
 Physical schema:
– Relations stored as unordered files.
– Index on first column of Students.
 External Schema (View):
– Course_info(cid:string, enrollment:integer)
– CS542Students(sid: string, grade:string)
Data Independence
 Applications insulated from how data is
structured and stored.
 Logical data independence:
– Protection from changes in logical structure
of data.
 Physical data independence:
– Protection from changes in physical
structure of data.
* One of the most important benefits of using a DBMS!
Files vs. DBMS
 Stage large datasets between main memory
and secondary storage (buffering, page-
oriented access)
 Must write special code for different queries
 Must protect data from inconsistency due to
multiple concurrent users
 Must manage crash recovery in some
special-purpose manner
 Must provide good methods for access
control
If we were to use files, we would have to :
Why Use a DBMS?
 Reduced application development time.
 Data independence
 Efficient data access.
 Data integrity under updates.
 Concurrent access
 Recovery from crashes.
 Security
 Uniform data administration.
Transaction Management
 A transaction is a collection of operations that
performs a single logical function in a
database application.
 Transaction-management component
ensures that the database remains in a
consistent (correct) state despite system
failures (e.g. power failures and operating
system crashes) and transaction failures.
 Concurrency-control manager controls the
interaction among the concurrent
transactions, to ensure the consistency of the
database.
Concurrency Control
 Concurrent execution of user programs
is essential for good DBMS performance.
– Because disk accesses are frequent, and relatively
slow, it is important to keep CPU humming by
working on several user programs concurrently.
 Interleaving actions of different user programs
can lead to inconsistency:
– e.g., check is cleared while account balance is being
computed.
 DBMS ensures such data inconsistency
problems don’t arise:
– E.g., users can pretend they are using a single-user
system
Concurrency Control
Key Concepts of CC
 Key concept is transaction, which is an
atomic sequence of multiple database
actions (reads/writes)
 Each transaction, executed completely,
must leave the DB in a consistent state
 Utilize locking of resources and other
protocols for guaranteeing consistency.
System Crash : Ensuring Atomicity
 If system crashes in the middle of a
process, then DBMS ensures atomicity
 Idea: Keep a log (history) of all actions
carried out by the DBMS while
executing a process :
– Before a change is made to database,
corresponding log entry is forced to a safe
location (commit of transaction)
– After a crash, the effects of partially
executed transactions are undone using
the log (rollback of transaction)
Storage Management
 A storage manager is a program module that
provides the interface between the low-level
data stored in the database and the
application programs and queries submitted
to the system.
 The storage manager is responsible for the
following tasks:
– Interaction with the file manager
– Efficient storing, retrieving, and updating of data
Databases make these folks
happy ...
 End users and DBMS vendors
 DB application programmers
– E.g., smart webmasters
 Database administrator (DBA)
– Designs logical /physical schemas
– Handles security and authorization
– Data availability, crash recovery
– Database tuning as needs evolve
Must understand how a DBMS works!
Structure of a DBMS
 A typical DBMS
has a layered
architecture.
 Concurrency
control and
recovery
components not
shown.
Query Optimization
and Execution
Relational Operators
Files and Access Methods
Buffer Management
Disk Space Management
DB
These layers
must consider
concurrency
control and
recovery
KEYS
 Associative addressing is based on keys – a
column, or group of columns, used to identify
rows.
 Simple key – a key formed from a single column
 Composite key – a key formed from several
columns
 The relational model has five kinds of keys
• Super
• Candidate
• Primary
• Alternate (secondary)
• Foreign
Super Key
 A superkey is any set of attributes that
uniquely identifies a row. A superkey
differs from a candidate key in that it
does not require the non redundancy
property.
Candidate
 A candidate key is an attribute (or set of
attributes) that uniquely identifies a row. A
candidate key must possess the following
properties:
Unique identification - For every row the
value of the key must uniquely identify that
row.
Non redundancy - No attribute in the key can
be discarded without destroying the property
of unique identification.
Primary Key
 A primary key is the candidate key
which is selected as the principal unique
identifier. Every relation must contain a
primary key. The primary key is usually
the key selected to identify a row when
the database is physically implemented.
For example, a part number is selected
instead of a part description
Alternate (secondary)
 The Candidate key which is not
selected for primary key are known as
secondary or alternate key
Forign Key
 A foreign key is an attribute (or set of
attributes) that appears (usually) as a
non key attribute in one relation and as
a primary key attribute in another
relation. I say usually because it is
possible for a foreign key to also be the
whole or part of a primary key
CIS-552 Introduction 31
Overall System Structure
indices Statistical data
Data files Data dictionary
disk storage
Summary
 DBMS used to maintain & query large datasets.
 Benefits include recovery from system crashes,
concurrent access, quick application
development, data integrity and security.
 Levels of abstraction give data independence.
 A DBMS typically has a layered architecture.
 DBAs hold rewarding jobs. 
 DBMS R&D is one of the broadest,
most exciting areas in CS.

More Related Content

Similar to DBMS Full.ppt

A N S I S P A R C Architecture
A N S I  S P A R C  ArchitectureA N S I  S P A R C  Architecture
A N S I S P A R C ArchitectureSabeeh Ahmed
 
Database Management system, database architecture unikkkkkkkkkkkkkkk
Database Management system, database architecture unikkkkkkkkkkkkkkkDatabase Management system, database architecture unikkkkkkkkkkkkkkk
Database Management system, database architecture unikkkkkkkkkkkkkkksandhyakiran10
 
Database management system
Database management systemDatabase management system
Database management systemsonykhan3
 
DBMS introduction and functionality of of dbms
DBMS introduction and functionality of  of dbmsDBMS introduction and functionality of  of dbms
DBMS introduction and functionality of of dbmsranjana dalwani
 
Database Systems - introduction
Database Systems - introductionDatabase Systems - introduction
Database Systems - introductionJananath Banuka
 
Introduction To Database.ppt
Introduction To Database.pptIntroduction To Database.ppt
Introduction To Database.pptRithikRaj25
 
M.sc. engg (ict) admission guide database management system 4
M.sc. engg (ict) admission guide   database management system 4M.sc. engg (ict) admission guide   database management system 4
M.sc. engg (ict) admission guide database management system 4Syed Ariful Islam Emon
 
Database Management System Introduction
Database Management System IntroductionDatabase Management System Introduction
Database Management System IntroductionSmriti Jain
 
Database management systems
Database management systemsDatabase management systems
Database management systemsJoel Briza
 

Similar to DBMS Full.ppt (20)

A N S I S P A R C Architecture
A N S I  S P A R C  ArchitectureA N S I  S P A R C  Architecture
A N S I S P A R C Architecture
 
Ppt 2
Ppt 2Ppt 2
Ppt 2
 
Database Management system, database architecture unikkkkkkkkkkkkkkk
Database Management system, database architecture unikkkkkkkkkkkkkkkDatabase Management system, database architecture unikkkkkkkkkkkkkkk
Database Management system, database architecture unikkkkkkkkkkkkkkk
 
Database management system
Database management systemDatabase management system
Database management system
 
DB_Lec_1 and 2.pptx
DB_Lec_1 and 2.pptxDB_Lec_1 and 2.pptx
DB_Lec_1 and 2.pptx
 
DBMS introduction and functionality of of dbms
DBMS introduction and functionality of  of dbmsDBMS introduction and functionality of  of dbms
DBMS introduction and functionality of of dbms
 
Unit 1 DBMS
Unit 1 DBMSUnit 1 DBMS
Unit 1 DBMS
 
Lecture1
Lecture1Lecture1
Lecture1
 
Database Concepts.ppt
Database Concepts.pptDatabase Concepts.ppt
Database Concepts.ppt
 
1_DBMS_Introduction.pdf
1_DBMS_Introduction.pdf1_DBMS_Introduction.pdf
1_DBMS_Introduction.pdf
 
DataMgt - UNIT-I .PPT
DataMgt - UNIT-I .PPTDataMgt - UNIT-I .PPT
DataMgt - UNIT-I .PPT
 
DBMS.pptx
DBMS.pptxDBMS.pptx
DBMS.pptx
 
DBMS and its Models
DBMS and its ModelsDBMS and its Models
DBMS and its Models
 
Unit 1.pptx
Unit 1.pptxUnit 1.pptx
Unit 1.pptx
 
Database Systems - introduction
Database Systems - introductionDatabase Systems - introduction
Database Systems - introduction
 
Introduction To Database.ppt
Introduction To Database.pptIntroduction To Database.ppt
Introduction To Database.ppt
 
M.sc. engg (ict) admission guide database management system 4
M.sc. engg (ict) admission guide   database management system 4M.sc. engg (ict) admission guide   database management system 4
M.sc. engg (ict) admission guide database management system 4
 
20CS402_Unit_1.pptx
20CS402_Unit_1.pptx20CS402_Unit_1.pptx
20CS402_Unit_1.pptx
 
Database Management System Introduction
Database Management System IntroductionDatabase Management System Introduction
Database Management System Introduction
 
Database management systems
Database management systemsDatabase management systems
Database management systems
 

Recently uploaded

AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdfAMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdfphamnguyenenglishnb
 
Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designKeynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designMIPLM
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
Grade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptxGrade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptxChelloAnnAsuncion2
 
ROOT CAUSE ANALYSIS PowerPoint Presentation
ROOT CAUSE ANALYSIS PowerPoint PresentationROOT CAUSE ANALYSIS PowerPoint Presentation
ROOT CAUSE ANALYSIS PowerPoint PresentationAadityaSharma884161
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxpboyjonauth
 
Hierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementHierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementmkooblal
 
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...JhezDiaz1
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTiammrhaywood
 
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfFraming an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfUjwalaBharambe
 
Atmosphere science 7 quarter 4 .........
Atmosphere science 7 quarter 4 .........Atmosphere science 7 quarter 4 .........
Atmosphere science 7 quarter 4 .........LeaCamillePacle
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17Celine George
 
DATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersDATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersSabitha Banu
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Celine George
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxthorishapillay1
 
Romantic Opera MUSIC FOR GRADE NINE pptx
Romantic Opera MUSIC FOR GRADE NINE pptxRomantic Opera MUSIC FOR GRADE NINE pptx
Romantic Opera MUSIC FOR GRADE NINE pptxsqpmdrvczh
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for BeginnersSabitha Banu
 

Recently uploaded (20)

AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdfAMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
 
Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designKeynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-design
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
 
Grade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptxGrade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptx
 
9953330565 Low Rate Call Girls In Rohini Delhi NCR
9953330565 Low Rate Call Girls In Rohini  Delhi NCR9953330565 Low Rate Call Girls In Rohini  Delhi NCR
9953330565 Low Rate Call Girls In Rohini Delhi NCR
 
ROOT CAUSE ANALYSIS PowerPoint Presentation
ROOT CAUSE ANALYSIS PowerPoint PresentationROOT CAUSE ANALYSIS PowerPoint Presentation
ROOT CAUSE ANALYSIS PowerPoint Presentation
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptx
 
Hierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementHierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of management
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
 
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfFraming an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
 
Atmosphere science 7 quarter 4 .........
Atmosphere science 7 quarter 4 .........Atmosphere science 7 quarter 4 .........
Atmosphere science 7 quarter 4 .........
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17
 
DATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersDATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginners
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptx
 
Rapple "Scholarly Communications and the Sustainable Development Goals"
Rapple "Scholarly Communications and the Sustainable Development Goals"Rapple "Scholarly Communications and the Sustainable Development Goals"
Rapple "Scholarly Communications and the Sustainable Development Goals"
 
Romantic Opera MUSIC FOR GRADE NINE pptx
Romantic Opera MUSIC FOR GRADE NINE pptxRomantic Opera MUSIC FOR GRADE NINE pptx
Romantic Opera MUSIC FOR GRADE NINE pptx
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for Beginners
 

DBMS Full.ppt

  • 2. What is a database?  A very large, integrated collection of data.  Models real-world application : – Entities (students, courses) – Relationships (links,refrences)  Usually data is too large to fit into main memory, and often used by many users
  • 3. Database applications ?  E-commerce : Amazon.com, etc.  Airlines and travel services  Scientific data such as biology, oceanography, etc.  Spatial data such as maps, travel networks,  World Wide Web  Digital libraries of artifacts of any kind
  • 4. What is a DBMS ?  DBMS stands for Database Management System  software package designed to store, manage and provide access to databases.
  • 5. Why Study Databases??  Shift from computation to information  Datasets increasing in diversity and volume. – Digital libraries, interactive video, Human Genome project, EOS project – ... need for DBMS exploding  DBMS encompasses most of CS : – OS, languages, theory, AI, multimedia, logic ?
  • 6. Terminology : Data Models  A data model : – is a collection of concepts for describing data.  A schema : – is a description of a particular collection of data, using the given data model.  The relational model of data – The most widely used model today. – Main concept: relation, basically a table with rows and columns. – Every relation has a schema, which describes the columns, or fields.
  • 7. Data Definition Language (DDL)  Specification notation for defining the database schema  DDL compiler generates a set of tables stored in a data dictionary  Data dictionary contains metadata (data about data)  Data storage and definition language – special type of DDL in which the storage structure and access methods used by the database system are specified
  • 8. Data Manipulation Language (DML)  Language for accessing and manipulating the data organized by the appropriate data model  Two classes of languages – Procedural – user specifies what data is required and how to get those data – Nonprocedural – user specifies what data is required without specifying how to get those data
  • 9. Database schema  Its structure described in a formal language supported by (DBMS) and refers to the organization of data to create a blueprint of how a database will be constructed
  • 10. DBMS Keys  A key is an attribute also known as a combination of attribute that is used to identify records. Sometimes we might have to retrieve data from more than one table, in those cases we require to join tables with the help of keys. The purpose of the key is to bind data together across tables without repeating all of the data in every table.
  • 11. Levels of Abstraction  Many views: – Views describe how users see the data.  Single conceptual (logical) schema – Conceptual schema defines logical structure  Single physical schema: – Physical schema describes the files and indexes used. * Schemas are defined using Data Definition Language ; * data is modified/queried using Data Manipulation Language Physical Schema Conceptual Schema View 1 View 2 View 3
  • 12. Example: University Database  Conceptual schema: – Students(sid: string, name: string, login: string, age: integer, gpa:real) – Courses(cid: string, cname:string, credits:integer) – Enrolled(sid:string, cid:string, grade:string)  Physical schema: – Relations stored as unordered files. – Index on first column of Students.  External Schema (View): – Course_info(cid:string, enrollment:integer) – CS542Students(sid: string, grade:string)
  • 13. Data Independence  Applications insulated from how data is structured and stored.  Logical data independence: – Protection from changes in logical structure of data.  Physical data independence: – Protection from changes in physical structure of data. * One of the most important benefits of using a DBMS!
  • 14. Files vs. DBMS  Stage large datasets between main memory and secondary storage (buffering, page- oriented access)  Must write special code for different queries  Must protect data from inconsistency due to multiple concurrent users  Must manage crash recovery in some special-purpose manner  Must provide good methods for access control If we were to use files, we would have to :
  • 15. Why Use a DBMS?  Reduced application development time.  Data independence  Efficient data access.  Data integrity under updates.  Concurrent access  Recovery from crashes.  Security  Uniform data administration.
  • 16. Transaction Management  A transaction is a collection of operations that performs a single logical function in a database application.  Transaction-management component ensures that the database remains in a consistent (correct) state despite system failures (e.g. power failures and operating system crashes) and transaction failures.  Concurrency-control manager controls the interaction among the concurrent transactions, to ensure the consistency of the database.
  • 17. Concurrency Control  Concurrent execution of user programs is essential for good DBMS performance. – Because disk accesses are frequent, and relatively slow, it is important to keep CPU humming by working on several user programs concurrently.  Interleaving actions of different user programs can lead to inconsistency: – e.g., check is cleared while account balance is being computed.  DBMS ensures such data inconsistency problems don’t arise: – E.g., users can pretend they are using a single-user system
  • 19. Key Concepts of CC  Key concept is transaction, which is an atomic sequence of multiple database actions (reads/writes)  Each transaction, executed completely, must leave the DB in a consistent state  Utilize locking of resources and other protocols for guaranteeing consistency.
  • 20. System Crash : Ensuring Atomicity  If system crashes in the middle of a process, then DBMS ensures atomicity  Idea: Keep a log (history) of all actions carried out by the DBMS while executing a process : – Before a change is made to database, corresponding log entry is forced to a safe location (commit of transaction) – After a crash, the effects of partially executed transactions are undone using the log (rollback of transaction)
  • 21. Storage Management  A storage manager is a program module that provides the interface between the low-level data stored in the database and the application programs and queries submitted to the system.  The storage manager is responsible for the following tasks: – Interaction with the file manager – Efficient storing, retrieving, and updating of data
  • 22. Databases make these folks happy ...  End users and DBMS vendors  DB application programmers – E.g., smart webmasters  Database administrator (DBA) – Designs logical /physical schemas – Handles security and authorization – Data availability, crash recovery – Database tuning as needs evolve Must understand how a DBMS works!
  • 23. Structure of a DBMS  A typical DBMS has a layered architecture.  Concurrency control and recovery components not shown. Query Optimization and Execution Relational Operators Files and Access Methods Buffer Management Disk Space Management DB These layers must consider concurrency control and recovery
  • 24. KEYS  Associative addressing is based on keys – a column, or group of columns, used to identify rows.  Simple key – a key formed from a single column  Composite key – a key formed from several columns  The relational model has five kinds of keys • Super • Candidate • Primary • Alternate (secondary) • Foreign
  • 25. Super Key  A superkey is any set of attributes that uniquely identifies a row. A superkey differs from a candidate key in that it does not require the non redundancy property.
  • 26. Candidate  A candidate key is an attribute (or set of attributes) that uniquely identifies a row. A candidate key must possess the following properties: Unique identification - For every row the value of the key must uniquely identify that row. Non redundancy - No attribute in the key can be discarded without destroying the property of unique identification.
  • 27. Primary Key  A primary key is the candidate key which is selected as the principal unique identifier. Every relation must contain a primary key. The primary key is usually the key selected to identify a row when the database is physically implemented. For example, a part number is selected instead of a part description
  • 28. Alternate (secondary)  The Candidate key which is not selected for primary key are known as secondary or alternate key
  • 29. Forign Key  A foreign key is an attribute (or set of attributes) that appears (usually) as a non key attribute in one relation and as a primary key attribute in another relation. I say usually because it is possible for a foreign key to also be the whole or part of a primary key
  • 30. CIS-552 Introduction 31 Overall System Structure indices Statistical data Data files Data dictionary disk storage
  • 31. Summary  DBMS used to maintain & query large datasets.  Benefits include recovery from system crashes, concurrent access, quick application development, data integrity and security.  Levels of abstraction give data independence.  A DBMS typically has a layered architecture.  DBAs hold rewarding jobs.   DBMS R&D is one of the broadest, most exciting areas in CS.