SlideShare une entreprise Scribd logo
1  sur  45
Database System Concepts and
Architecture
Data Models: A data model is a collection of concepts that
can be used to describe the structure of a database.
Hierarchical Model
Advantages :
This model allows easy addition and deletion of information.
Data at the top of the hierarchy is very fast to access.
The model relates very well to natural hierarchies.
Disadvantages:
 Complex implementation
Predefined tree structure reduces flexibility
The database can be very slow when searching for information on
the lower entities
Network Model
Advantages:
The network model is conceptual simple and easy to design.
The network model can handle one to many and many to many
relationships.
Data access is easier and flexible.
Better than Hierarchical model in isolating the programs from the
complex physical storage details.
Disadvantages:
All the records are maintained using pointers database structure
becomes very complex.
Insertion ,deletion and updating operations of record require large
number of pointers adjustments.
Structural changes to the database are very difficult.
Relational Database Model
Advantages:
• Tables consisting of rows and columns are easy to understand.
• Very flexible
• Widely used
• Security control and authorization can be implemented easily.
• Disadvantages:
• For large databases, Performance is responding to queries is
degraded.
• Physical storage consumption.
• Slow extraction of meaning from data.
Object oriented Model
Advantages:
• Applicable to advanced database applications.
• Improved performance
• Capable of handling a large variety of data types.
• More expressive query language
Disadvantages:
• Lack of universal data model
• Lack of support for security
• Locking at object level may impact performance.
Object relational Model
Advantages:
• Reuse and sharing
• Increased Productivity
• Use of experience in developing RBMS
Disadvantages:
• It is more complex than traditional database
• It associates with cost.
Database Schemas
Database schema represents skeleton structure that
represents the logical view of entire database.
It defines how the data is organized and how the relations
among them are associated.
It formulates all the constraints that are to be applied on the
data.
Physical Database Schema:
This Schema relates to the actual storage like files, indices.
It defines how the data will be stored in a secondary storage.
Logical Database Schema:
 This schema defines all the logical constraints that need to be
applied on the data stored.
It defines tables, views, and integrity constraints.
Database Schema
Database Instance:
 The data in the database at a particular moment in time is called
Instances. It is also called as Database state or Snapshot.
(or)
A database instance is a set of memory structure
and background processes that access a set of data base file.
DBMS Architecture: Database architecture focuses on design,
development, implementation and maintenance of computer
programs that store and organize Information for business , agencies
and institutions.
Three Schema Architecture
Three Schema Architecture:
It is also known as three levels of data abstraction .
The goal of Three schema architectures is to separate the user
applications and the physical database.
The three levels of DBMS architecture are
 Internal level
 Conceptual level
 Externa level
• Internal or Physical level: This level describes the
physical storage structure of the database. It uses the
physical data model and describes the complete
details of data storage and access paths for the
database.
• Conceptual or Logical level: This level describes the
structure of the whole database for the users. It
hides the details of physical storage structures and
concentrates on describing entities, data types,
relationships, user operations and constraints.
• External or View level: This level includes a number
of external schemas or user views. Each external
schema describes the part of the database that a
particular user group is interested in and hides the
rest of the database from that user group.
Client server Architecture
Client Server Architecture or Two Tier Architecture :It is used for
user interface program and application programs that runs on client
side.
• An interface called ODBC(open database connectivity)provides an
API that allows client side program to call the DBMS.
• In this architecture , the request entered to application layer and
request is sent to database layer.
• Once the request is processed in database, the result is sent back to
application layer for the user.
Advantages:
• Easy to understand, directly communicates with database.
• Requested data can be retrieved very quickly .
• Easy to modify.
• Easy to maintain.
Disadvantages:
• It would be time consuming.
• This architecture would be cost effective.
Three Tier Architecture / Server Architecture:
 It separates its tiers from each other based on complexity of the
users and how they use the data present in the database.
 It is commonly used in web applications.
 Intermediate layer called web server stores web connectivity
software and business logic part of application used to access the
right amount of data from the database server.
 Web server acts like a medium for sending partially processed data
between the database server and the client.
Advantages:
Managing data is independent from the physical storage.
Migration to new graphical environments is faster.
It is possible to make changes in presentation layer without affecting
other two level.
One tier fails there is no data loss, because you are always secure by
accessing the other tier.
Disadvantages:
It is more complex structure.
More difficult to set up and maintain.
More difficult to build 3-tier application.
Physical Centralized Architecture
Centralized database is a database that is located ,stored, and
maintained in a single location.
Advantages:
Data integrity is maximized and data redundancy is minimized.
 Bigger data security
Better data prevention
Easy for end user due to simplicity
Generally easy data portability and data administration
 More Cost effective
All the information can be accessed at the same time from the
same location.
Updates to any given data are immediately received by every
end user.
Data kept in same location is easier to changed,re-organised
and analyzed
Disadvantages:
Highly dependent on network connectivity.
Bottlenecks can occur as a result of high traffic.
Less efficiency.
There is minimal to none data redundancy, if a set of data is
unexpectedly lost it is very difficult to retrieve it back.
Data Independence: It is defined as the capacity to change the
schema at one level of the database system, without affecting
the schema at the next higher level.
Logical data independence: Capacity to change the
conceptual schema without having to change external schema
or application program.
Physical data independence: Capacity to change the internal
schema without having change to conceptual schema.
Database Languages:
1. DDL( Data Definition Language): These statements are used
to alter modify a database or table structure and schema.
a) Create
b) Alter
c) Drop
d) Truncate
Create is used to create schema, tables, index, and constraints
in the database.
Syntax: Create table table_name(column datatype,column2
datatype,………columnn datatype);
Ex: create table student (regno int ,name varchar(20),dob date,
marks int);
Alter command is used to modify the structure of the schema
or table.
Syntax: ALTER TABLE table_name ADD column_name datatype
Ex: Alter table student add address varchar(40);
Drop statement is used to remove the table or index from the
database.
Syntax: Drop table table _name;
Ex: Drop table student;
Truncate statement is used to remove the content of the table.
but keeps the structure of the table.
Syntax: Truncate table table _name;
Ex: Truncate table student;
(DML)Data Manipulation Language: DML helps to handle user
requests. That is to insert ,delete, update, and retrieve the data
from database.
1) Select
2) Insert
3) Update
4) Delete
Select command helps to retrieve the records from the tables in
the database.
It either retrieve the entire data from the table or specific
records.
Syntax: Select column_list from table name;
Ex: Select * from student;
Insert statement is used to insert new records into the table.
Syntax: Insert into table_name(col 1,col2,col3,…..coln)values
(value1, value2, value3,…..);
Ex: Insert into student (regno, name, dob, phone) values (01,
‘Thimma’,’01-jan-2002’, 9988776655);
Update statement is used to modify the data value in the table.
Syntax: Update table _name SET column_name1 =
value1,column_name2= value2,…column_nameN = value;
Ex: UPDATE student set total=total+10;
Delete statement is used to delete the records in the entire
table or specific records by specifying the condition.
Syntax; DELETE from table_name[where condition];
Ex: DELETE from student where regno =01;
Data Control Language [DCL]: DCL languages are used to control the
user access to the database, tables, views, procedures, functions and
packages. They give different levels of access to the objects in the
database.
DCL commands are:
 Grant
 Revoke.
GRANT provides the privileges to the users on the database objects.
The privileges could be select, delete, update and insert on the tables
and views.
Syntax of GRANT
GRANT privilege_name
ON object_name
TO {user_name |PUBLIC |role_name}
[WITH GRANT OPTION];
Ex: GRANT select, insert on student to user1;
• REVOKE removes the privileges given on the database objects.
We can remove all the privileges or remove one or more
privileges from the objects.
• Syntax
REVOKE privilege_name ON object_name
FROM {user_name |PUBLIC|role_name};
Ex: REVOKE insert on student from user1;
Transaction Control Language (TCL):
Transaction Control Language (TCL) commands are used to
manage transactions in database.
These are used to manage the changes made by DML
statements.
 Commit
 Rollback
 Savepoint
• COMMIT saves the transaction on the database. The transaction can be
insert, delete or update.
• The transaction can be insert ,delete or update.
Syntax: Commit;
Ex: update student set sname = ‘Thimma S ‘where regno. =100;
COMMIT;
ROLLBACK command is used to undo the insert, delete or update
transaction in the database. It undoes the transaction performed on the
table and restores the previous stored value.
Syntax : ROLLBACK;
Ex: update student set sname = ‘Thimma ‘ where regno = 100;
ROLLBACK;
SAVEPOINT is a point in a transaction when you can roll the transaction
back to a certain point without rolling back the entire transaction.
Syntax :SAVEPOINT SAVEPOINT _NAME;
Ex: update student set sname = ‘Thimma’ where regno =100;
SAVEPOINT S 1;
update student set age = 15 where regno = 100;
ROLLBACK to S1;
DBMS Interfaces:
Form Based interfaces
Text Based interfaces
GIS Based interfaces
Menu Based interfaces for Web Clients or Browsing
Interfaces for the DBA
Form Based interfaces :
These interfaces are wide spread and a very important means
of interacting with a DBMS.
Easy to use ,user may not require special knowledge about
database languages like SQL.
Text Based interfaces:
These interfaces are very powerful tools and allow a
comprehensive interaction with a DBMS.
These is based on active knowledge of the respective
database language.
GIS Interface(Geographic Information System):
User interface often integrates features of database interface.
The database interaction takes place through the combination
of different interfaces.
a) Graphical interaction via a selection on the map
b) Combination of from-based and text based interaction.
Menu based interfaces for web Clients or Browsing :
These interfaces present the user with the list of options , called
menu that lead the user the user through the formation of a
request.
Interfaces for the DBA :
Most database system contains privileged commands that can
be used only by the DBA staff.
These include commands for creating accounts , setting
system parameters, granting account authorization, changing
schema , reorganizing the storage structures of a databases.
DBMS ComponentModules
Database System Utilities:
Most DBMS have database utilities that help the DBA in the managing the
database system.
Common utilities have the following types of functions:
Loading
Backup
File reorganization
Performance monitoring
Classification of Database Management Systems:
o Classification based on Data Model
o Classification based on User Numbers
o Classification based on database Distribution
Classification based on Data Model:
 Most popular data models we use today is relational data model . Like
Oracle , MY SQL
 Traditional models like hierarchical model and network model are still
used in industry mainly in mainframe. They are not commonly used due
to complexity.
 In recent years , the newer Object –oriented data models are
introduced. In this database management the information is
represented in the form of objects as used in object oriented
programming. These are different from relational database.
Classification Based on User Numbers:
• Single-user database system , which supports one user at a
time.
• Multiple database system , which supports multiple users
concurrently.
Classification Based on Database Distribution:
• Centralized Systems
• Distributed Database System
Centralized Systems the DBMS and database are stored at a
single site that is used by several other systems.
Centralized Systems
DistributedDatabaseSystem
Distributed Database System:
The actual database and the DBMS software are distributed
from various sites that are connected by a computer network.
Distributed databases can be classified into two types:
1) Homogeneous Distributed Database System
2) Heterogeneous Distributed Database System
Homogeneous Distributed Database System use the same
DBMS software from multiple sites.
Heterogeneous Distributed Database System different sites
might use different DBMS software ,but there is additional
common software to support data exchange between these
sites.
Comparison between Hierarchical, Network, and
RelationalModel
Hierarchical model Network model Relational model
One to many or one to
one relationship
Many to many
relationship
One to one , one to
many , many to many
relationship
Based on parent child
relationship
A record can have many
parents as well as many
children
Based on relational data
structures
Retrieve algorithms are
complex and asymmetric
Retrieve algorithms are
complex and symmetric
Retrieve algorithms are
simple and symmetric
Cannot insert the
information of a child
who does not have any
parent
Does not suffer from any
insertion anomaly
Does not suffer from any
insertion anomaly
Multiple occurrences of
child records which lead
to problems of
inconsistency during the
update operation
Free from update
anomalies
Free from update
anomalies
Deletion of parent
results in deletion of
child records
Free from delete
anomalies
Free from delete
anomalies
Comparisonb/wCentralizedand
DistributedDBMS
Centralized
• Database is maintained
at one site.
• If centralized system fails
entire system is halted.
• Less reliable
• Less complication
Distributed
• Data is maintained at a
number of different
sites.
• If one system fails,
system continues work
with other sites .
• More reliable
• More complication

Contenu connexe

Similaire à 2nd chapter dbms.pptx

CP 121_2.pptx about time to be implement
CP 121_2.pptx about time to be implementCP 121_2.pptx about time to be implement
CP 121_2.pptx about time to be implement
flyinimohamed
 

Similaire à 2nd chapter dbms.pptx (20)

Unit 1.pptx
Unit 1.pptxUnit 1.pptx
Unit 1.pptx
 
CHAPTER 1 Database system architecture.pptx
CHAPTER 1 Database system architecture.pptxCHAPTER 1 Database system architecture.pptx
CHAPTER 1 Database system architecture.pptx
 
Ch1_Intro-95(1).ppt
Ch1_Intro-95(1).pptCh1_Intro-95(1).ppt
Ch1_Intro-95(1).ppt
 
csedatabasemanagementsystemppt-170825044344.pdf
csedatabasemanagementsystemppt-170825044344.pdfcsedatabasemanagementsystemppt-170825044344.pdf
csedatabasemanagementsystemppt-170825044344.pdf
 
Database Management System ppt
Database Management System pptDatabase Management System ppt
Database Management System ppt
 
DBMS-Unit-1.pptx
DBMS-Unit-1.pptxDBMS-Unit-1.pptx
DBMS-Unit-1.pptx
 
Database Management System
Database Management SystemDatabase Management System
Database Management System
 
Database-management-system-dbms-ppt.pptx
Database-management-system-dbms-ppt.pptxDatabase-management-system-dbms-ppt.pptx
Database-management-system-dbms-ppt.pptx
 
ARCHITECTURE OF DBMS (1).ppt
ARCHITECTURE OF DBMS (1).pptARCHITECTURE OF DBMS (1).ppt
ARCHITECTURE OF DBMS (1).ppt
 
Database system
Database systemDatabase system
Database system
 
Database system-DBMS
Database system-DBMSDatabase system-DBMS
Database system-DBMS
 
Database system
Database systemDatabase system
Database system
 
Database system
Database systemDatabase system
Database system
 
Fundamentals of database system - Database System Concepts and Architecture
Fundamentals of database system - Database System Concepts and ArchitectureFundamentals of database system - Database System Concepts and Architecture
Fundamentals of database system - Database System Concepts and Architecture
 
Presentation on Database management system
Presentation on Database management systemPresentation on Database management system
Presentation on Database management system
 
Database Management Systems.ppt
Database Management Systems.pptDatabase Management Systems.ppt
Database Management Systems.ppt
 
database1.pdf
database1.pdfdatabase1.pdf
database1.pdf
 
Unit 1.2.pptx
Unit 1.2.pptxUnit 1.2.pptx
Unit 1.2.pptx
 
Unit 1: Introduction to DBMS Unit 1 Complete
Unit 1: Introduction to DBMS Unit 1 CompleteUnit 1: Introduction to DBMS Unit 1 Complete
Unit 1: Introduction to DBMS Unit 1 Complete
 
CP 121_2.pptx about time to be implement
CP 121_2.pptx about time to be implementCP 121_2.pptx about time to be implement
CP 121_2.pptx about time to be implement
 

Dernier

Top Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoor
Top Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoorTop Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoor
Top Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoor
dharasingh5698
 
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort ServiceCall Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
AKTU Computer Networks notes --- Unit 3.pdf
AKTU Computer Networks notes ---  Unit 3.pdfAKTU Computer Networks notes ---  Unit 3.pdf
AKTU Computer Networks notes --- Unit 3.pdf
ankushspencer015
 
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar ≼🔝 Delhi door step de...
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar  ≼🔝 Delhi door step de...Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar  ≼🔝 Delhi door step de...
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar ≼🔝 Delhi door step de...
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak HamilCara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Kandungan 087776558899
 

Dernier (20)

(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7
(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7
(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7
 
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
 
Top Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoor
Top Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoorTop Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoor
Top Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoor
 
KubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlyKubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghly
 
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordCCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
 
Water Industry Process Automation & Control Monthly - April 2024
Water Industry Process Automation & Control Monthly - April 2024Water Industry Process Automation & Control Monthly - April 2024
Water Industry Process Automation & Control Monthly - April 2024
 
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort ServiceCall Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
 
Thermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptThermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.ppt
 
Bhosari ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready For ...
Bhosari ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready For ...Bhosari ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready For ...
Bhosari ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready For ...
 
Generative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTGenerative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPT
 
AKTU Computer Networks notes --- Unit 3.pdf
AKTU Computer Networks notes ---  Unit 3.pdfAKTU Computer Networks notes ---  Unit 3.pdf
AKTU Computer Networks notes --- Unit 3.pdf
 
Unit 2- Effective stress & Permeability.pdf
Unit 2- Effective stress & Permeability.pdfUnit 2- Effective stress & Permeability.pdf
Unit 2- Effective stress & Permeability.pdf
 
Unit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdfUnit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdf
 
Intro To Electric Vehicles PDF Notes.pdf
Intro To Electric Vehicles PDF Notes.pdfIntro To Electric Vehicles PDF Notes.pdf
Intro To Electric Vehicles PDF Notes.pdf
 
UNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its PerformanceUNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its Performance
 
Double rodded leveling 1 pdf activity 01
Double rodded leveling 1 pdf activity 01Double rodded leveling 1 pdf activity 01
Double rodded leveling 1 pdf activity 01
 
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar ≼🔝 Delhi door step de...
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar  ≼🔝 Delhi door step de...Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar  ≼🔝 Delhi door step de...
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar ≼🔝 Delhi door step de...
 
chapter 5.pptx: drainage and irrigation engineering
chapter 5.pptx: drainage and irrigation engineeringchapter 5.pptx: drainage and irrigation engineering
chapter 5.pptx: drainage and irrigation engineering
 
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
 
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak HamilCara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
 

2nd chapter dbms.pptx

  • 1. Database System Concepts and Architecture Data Models: A data model is a collection of concepts that can be used to describe the structure of a database.
  • 3. Advantages : This model allows easy addition and deletion of information. Data at the top of the hierarchy is very fast to access. The model relates very well to natural hierarchies. Disadvantages:  Complex implementation Predefined tree structure reduces flexibility The database can be very slow when searching for information on the lower entities
  • 5. Advantages: The network model is conceptual simple and easy to design. The network model can handle one to many and many to many relationships. Data access is easier and flexible. Better than Hierarchical model in isolating the programs from the complex physical storage details.
  • 6. Disadvantages: All the records are maintained using pointers database structure becomes very complex. Insertion ,deletion and updating operations of record require large number of pointers adjustments. Structural changes to the database are very difficult.
  • 8. Advantages: • Tables consisting of rows and columns are easy to understand. • Very flexible • Widely used • Security control and authorization can be implemented easily. • Disadvantages: • For large databases, Performance is responding to queries is degraded. • Physical storage consumption. • Slow extraction of meaning from data.
  • 10. Advantages: • Applicable to advanced database applications. • Improved performance • Capable of handling a large variety of data types. • More expressive query language Disadvantages: • Lack of universal data model • Lack of support for security • Locking at object level may impact performance.
  • 12. Advantages: • Reuse and sharing • Increased Productivity • Use of experience in developing RBMS Disadvantages: • It is more complex than traditional database • It associates with cost.
  • 13. Database Schemas Database schema represents skeleton structure that represents the logical view of entire database. It defines how the data is organized and how the relations among them are associated. It formulates all the constraints that are to be applied on the data.
  • 14. Physical Database Schema: This Schema relates to the actual storage like files, indices. It defines how the data will be stored in a secondary storage. Logical Database Schema:  This schema defines all the logical constraints that need to be applied on the data stored. It defines tables, views, and integrity constraints.
  • 16. Database Instance:  The data in the database at a particular moment in time is called Instances. It is also called as Database state or Snapshot. (or) A database instance is a set of memory structure and background processes that access a set of data base file. DBMS Architecture: Database architecture focuses on design, development, implementation and maintenance of computer programs that store and organize Information for business , agencies and institutions.
  • 18. Three Schema Architecture: It is also known as three levels of data abstraction . The goal of Three schema architectures is to separate the user applications and the physical database. The three levels of DBMS architecture are  Internal level  Conceptual level  Externa level
  • 19. • Internal or Physical level: This level describes the physical storage structure of the database. It uses the physical data model and describes the complete details of data storage and access paths for the database. • Conceptual or Logical level: This level describes the structure of the whole database for the users. It hides the details of physical storage structures and concentrates on describing entities, data types, relationships, user operations and constraints. • External or View level: This level includes a number of external schemas or user views. Each external schema describes the part of the database that a particular user group is interested in and hides the rest of the database from that user group.
  • 21. Client Server Architecture or Two Tier Architecture :It is used for user interface program and application programs that runs on client side. • An interface called ODBC(open database connectivity)provides an API that allows client side program to call the DBMS. • In this architecture , the request entered to application layer and request is sent to database layer. • Once the request is processed in database, the result is sent back to application layer for the user.
  • 22. Advantages: • Easy to understand, directly communicates with database. • Requested data can be retrieved very quickly . • Easy to modify. • Easy to maintain. Disadvantages: • It would be time consuming. • This architecture would be cost effective.
  • 23.
  • 24. Three Tier Architecture / Server Architecture:  It separates its tiers from each other based on complexity of the users and how they use the data present in the database.  It is commonly used in web applications.  Intermediate layer called web server stores web connectivity software and business logic part of application used to access the right amount of data from the database server.  Web server acts like a medium for sending partially processed data between the database server and the client.
  • 25. Advantages: Managing data is independent from the physical storage. Migration to new graphical environments is faster. It is possible to make changes in presentation layer without affecting other two level. One tier fails there is no data loss, because you are always secure by accessing the other tier. Disadvantages: It is more complex structure. More difficult to set up and maintain. More difficult to build 3-tier application.
  • 27. Centralized database is a database that is located ,stored, and maintained in a single location. Advantages: Data integrity is maximized and data redundancy is minimized.  Bigger data security Better data prevention Easy for end user due to simplicity Generally easy data portability and data administration  More Cost effective All the information can be accessed at the same time from the same location. Updates to any given data are immediately received by every end user. Data kept in same location is easier to changed,re-organised and analyzed
  • 28. Disadvantages: Highly dependent on network connectivity. Bottlenecks can occur as a result of high traffic. Less efficiency. There is minimal to none data redundancy, if a set of data is unexpectedly lost it is very difficult to retrieve it back. Data Independence: It is defined as the capacity to change the schema at one level of the database system, without affecting the schema at the next higher level. Logical data independence: Capacity to change the conceptual schema without having to change external schema or application program. Physical data independence: Capacity to change the internal schema without having change to conceptual schema.
  • 29. Database Languages: 1. DDL( Data Definition Language): These statements are used to alter modify a database or table structure and schema. a) Create b) Alter c) Drop d) Truncate Create is used to create schema, tables, index, and constraints in the database. Syntax: Create table table_name(column datatype,column2 datatype,………columnn datatype); Ex: create table student (regno int ,name varchar(20),dob date, marks int);
  • 30. Alter command is used to modify the structure of the schema or table. Syntax: ALTER TABLE table_name ADD column_name datatype Ex: Alter table student add address varchar(40); Drop statement is used to remove the table or index from the database. Syntax: Drop table table _name; Ex: Drop table student; Truncate statement is used to remove the content of the table. but keeps the structure of the table. Syntax: Truncate table table _name; Ex: Truncate table student;
  • 31. (DML)Data Manipulation Language: DML helps to handle user requests. That is to insert ,delete, update, and retrieve the data from database. 1) Select 2) Insert 3) Update 4) Delete Select command helps to retrieve the records from the tables in the database. It either retrieve the entire data from the table or specific records. Syntax: Select column_list from table name; Ex: Select * from student;
  • 32. Insert statement is used to insert new records into the table. Syntax: Insert into table_name(col 1,col2,col3,…..coln)values (value1, value2, value3,…..); Ex: Insert into student (regno, name, dob, phone) values (01, ‘Thimma’,’01-jan-2002’, 9988776655); Update statement is used to modify the data value in the table. Syntax: Update table _name SET column_name1 = value1,column_name2= value2,…column_nameN = value; Ex: UPDATE student set total=total+10; Delete statement is used to delete the records in the entire table or specific records by specifying the condition. Syntax; DELETE from table_name[where condition]; Ex: DELETE from student where regno =01;
  • 33. Data Control Language [DCL]: DCL languages are used to control the user access to the database, tables, views, procedures, functions and packages. They give different levels of access to the objects in the database. DCL commands are:  Grant  Revoke. GRANT provides the privileges to the users on the database objects. The privileges could be select, delete, update and insert on the tables and views. Syntax of GRANT GRANT privilege_name ON object_name TO {user_name |PUBLIC |role_name} [WITH GRANT OPTION]; Ex: GRANT select, insert on student to user1;
  • 34. • REVOKE removes the privileges given on the database objects. We can remove all the privileges or remove one or more privileges from the objects. • Syntax REVOKE privilege_name ON object_name FROM {user_name |PUBLIC|role_name}; Ex: REVOKE insert on student from user1; Transaction Control Language (TCL): Transaction Control Language (TCL) commands are used to manage transactions in database. These are used to manage the changes made by DML statements.  Commit  Rollback  Savepoint
  • 35. • COMMIT saves the transaction on the database. The transaction can be insert, delete or update. • The transaction can be insert ,delete or update. Syntax: Commit; Ex: update student set sname = ‘Thimma S ‘where regno. =100; COMMIT; ROLLBACK command is used to undo the insert, delete or update transaction in the database. It undoes the transaction performed on the table and restores the previous stored value. Syntax : ROLLBACK; Ex: update student set sname = ‘Thimma ‘ where regno = 100; ROLLBACK; SAVEPOINT is a point in a transaction when you can roll the transaction back to a certain point without rolling back the entire transaction. Syntax :SAVEPOINT SAVEPOINT _NAME; Ex: update student set sname = ‘Thimma’ where regno =100; SAVEPOINT S 1; update student set age = 15 where regno = 100; ROLLBACK to S1;
  • 36. DBMS Interfaces: Form Based interfaces Text Based interfaces GIS Based interfaces Menu Based interfaces for Web Clients or Browsing Interfaces for the DBA Form Based interfaces : These interfaces are wide spread and a very important means of interacting with a DBMS. Easy to use ,user may not require special knowledge about database languages like SQL. Text Based interfaces: These interfaces are very powerful tools and allow a comprehensive interaction with a DBMS. These is based on active knowledge of the respective database language.
  • 37. GIS Interface(Geographic Information System): User interface often integrates features of database interface. The database interaction takes place through the combination of different interfaces. a) Graphical interaction via a selection on the map b) Combination of from-based and text based interaction. Menu based interfaces for web Clients or Browsing : These interfaces present the user with the list of options , called menu that lead the user the user through the formation of a request. Interfaces for the DBA : Most database system contains privileged commands that can be used only by the DBA staff. These include commands for creating accounts , setting system parameters, granting account authorization, changing schema , reorganizing the storage structures of a databases.
  • 39. Database System Utilities: Most DBMS have database utilities that help the DBA in the managing the database system. Common utilities have the following types of functions: Loading Backup File reorganization Performance monitoring Classification of Database Management Systems: o Classification based on Data Model o Classification based on User Numbers o Classification based on database Distribution Classification based on Data Model:  Most popular data models we use today is relational data model . Like Oracle , MY SQL  Traditional models like hierarchical model and network model are still used in industry mainly in mainframe. They are not commonly used due to complexity.  In recent years , the newer Object –oriented data models are introduced. In this database management the information is represented in the form of objects as used in object oriented programming. These are different from relational database.
  • 40. Classification Based on User Numbers: • Single-user database system , which supports one user at a time. • Multiple database system , which supports multiple users concurrently. Classification Based on Database Distribution: • Centralized Systems • Distributed Database System Centralized Systems the DBMS and database are stored at a single site that is used by several other systems.
  • 43. Distributed Database System: The actual database and the DBMS software are distributed from various sites that are connected by a computer network. Distributed databases can be classified into two types: 1) Homogeneous Distributed Database System 2) Heterogeneous Distributed Database System Homogeneous Distributed Database System use the same DBMS software from multiple sites. Heterogeneous Distributed Database System different sites might use different DBMS software ,but there is additional common software to support data exchange between these sites.
  • 44. Comparison between Hierarchical, Network, and RelationalModel Hierarchical model Network model Relational model One to many or one to one relationship Many to many relationship One to one , one to many , many to many relationship Based on parent child relationship A record can have many parents as well as many children Based on relational data structures Retrieve algorithms are complex and asymmetric Retrieve algorithms are complex and symmetric Retrieve algorithms are simple and symmetric Cannot insert the information of a child who does not have any parent Does not suffer from any insertion anomaly Does not suffer from any insertion anomaly Multiple occurrences of child records which lead to problems of inconsistency during the update operation Free from update anomalies Free from update anomalies Deletion of parent results in deletion of child records Free from delete anomalies Free from delete anomalies
  • 45. Comparisonb/wCentralizedand DistributedDBMS Centralized • Database is maintained at one site. • If centralized system fails entire system is halted. • Less reliable • Less complication Distributed • Data is maintained at a number of different sites. • If one system fails, system continues work with other sites . • More reliable • More complication