2. 2
DBMS File System
DBMS is a collection of data. In DBMS, the user is not required to write the procedures. File system is a collection of data. In this system, the user has to write the procedures for
managing the database.
DBMS gives an abstract view of data that hides the details. File system provides the detail of the data representation and storage of data.
DBMS provides a crash recovery mechanism, i.e., DBMS protects the user from the system failure. File system doesn't have a crash mechanism, i.e., if the system crashes while entering some data,
then the content of the file will lost.
DBMS provides a good protection mechanism. It is very difficult to protect a file under the file system.
DBMS contains a wide variety of sophisticated techniques to store and retrieve the data. File system can't efficiently store and retrieve the data.
DBMS takes care of Concurrent access of data using some form of locking. In the File system, concurrent access has many problems like redirecting the file while other
deleting some information or updating some information.
4. PURPOSE OF DATABASE SYSTEM
4
• Database : It is the collection of interrelated and meaningful data.
• Database Management System(DBMS) :
• DBMS contains information about a particular enterprise
• Collection of interrelated data
• Set of programs to access the data
• An environment that is both convenient and efficient to use
• Goal of DBMS : The primary goal of DBMS is to provide a way to store
and retrieve database information that is both convenient and efficient.
5. PURPOSE OF DATABASE SYSTEM
5
• Characteristics of DBMS :
• It provides secure and survivable medium for storage and retrieval
of data
• It deals with management of data.
• Defining structures for storing information
• Providing mechanism for the manipulation of information
• The system must ensure the safety of information stored , despite
system crashes.
• The data can be shared among several users and it is persistent.
6. PURPOSE OF DATABASE SYSTEM
6
Database System Applications :
Banking : For Account, Loan and Customer information
Airlines : For reservations and Schedule information
Universities : For Student information , Regulation and Academic
activities
Credit Card Transactions : For purchases on credit cards and generation
of monthly statements.
Telecommunications : For keeping records of calls, generating monthly
bill, maintaining balances on prepaid calling cards and storing
information on the communication networks.
Finance : For storing information about holdings, sales and purchases of
financial instruments such as stocks and bonds
7. PURPOSE OF DATABASE SYSTEM
7
• Sales : For customer, product, and purchase information
• Manufacturing : For tracking production of items in factories, inventory and
ordering of items
• Human Resources : For information about employees, salaries, payroll taxes and
benefits.
• Multimedia Databases : For storage and archival of Audio and Video files in online
applications
• Web databases : For keeping track of several web pages
• Data Mining : For discovery of new knowledge
8. Database System Verses File Systems
8
• The information can be either a conventional file processing system or a
database system.
• In conventional file processing system, each and every subsystem of
information system will have its own set of files and it leads to
duplication.
• But in DBMS, there is a single centralized database which minimizes the
data redundancy of data to a greater extent.
9. PURPOSE OF DATABASE SYSTEM
9
• Database : It is the collection of interrelated and meaningful data.
• Database Management System(DBMS) :
• DBMS contains information about a particular enterprise
• Collection of interrelated data
• Set of programs to access the data
• An environment that is both convenient and efficient to use
• Goal of DBMS : The primary goal of DBMS is to provide a way to store
and retrieve database information that is both convenient and efficient.
10. PURPOSE OF DATABASE SYSTEM
10
• Characteristics of DBMS :
• It provides secure and survivable medium for storage and retrieval
of data
• It deals with management of data.
• Defining structures for storing information
• Providing mechanism for the manipulation of information
• The system must ensure the safety of information stored , despite
system crashes.
• The data can be shared among several users and it is persistent.
11. PURPOSE OF DATABASE SYSTEM
11
Database System Applications :
Banking : For Account, Loan and Customer information
Airlines : For reservations and Schedule information
Universities : For Student information , Regulation and Academic activities
Credit Card Transactions : For purchases on credit cards and generation
of monthly statements.
Telecommunications : For keeping records of calls, generating monthly bill,
maintaining balances on prepaid calling cards and storing information on the
communication networks.
Finance : For storing information about holdings, sales and purchases of financial
instruments such as stocks and bonds
12. PURPOSE OF DATABASE SYSTEM
12
• Sales : For customer, product, and purchase information
• Manufacturing : For tracking production of items in factories, inventory and
ordering of items
• Human Resources : For information about employees, salaries, payroll taxes and
benefits.
• Multimedia Databases : For storage and archival of Audio and Video files in online
applications
• Web databases : For keeping track of several web pages
• Data Mining : For discovery of new knowledge
13. Database System Verses File Systems
13
• The information can be either a conventional file processing system or a
database system.
• In conventional file processing system, each and every subsystem of
information system will have its own set of files and it leads to
duplication.
• But in DBMS, there is a single centralized database which minimizes the
data redundancy of data to a greater extent.
14. ADVANTAGES OF DBMS
14
• Redundancy can be reduced
• Inconsistency can be avoided
• Data can be shared
• Standards can be enforced
• Security restrictions can be applied
• Integrity can be maintained
• Conflicting requirements can be balanced
15. DIS ADVANTAGES OF DBMS
15
• Complexity and Size
• Additional hardware Cost
• Cost of conversion
• Performance
• High impact of failure
16. DML
16
• Deals with
• The insertion of new information into database.
• The retrieval of information stored in the database
• The deletion of information from the database
• The modification of information in the database
19. DML COMMANDS
19
• Two types of DML :
• Procedural DML : Require a user to specify what data are needed
and how to get those data. E.g. Relational Algebra
• Non Procedural DML : Require a user to specify what data are
needed without specifying how to get those data. E.g. Tuple
Relational Calculus
• Query Language : The portion of DML that involves
information retrieval is called query language. A query is
statement requesting the retrieval of information .
• E.g Select statement is the example of query.
21. DB ARCHITECTURE
21
• A database system is partitioned into modules that deal with each
of the responsibilities of the overall system.
• The main functional components of database system are :
• Storage Manager : It which handles the storage space required
for database manager.
• Query Processor :It helps the database system simplify and
facilitate access to data.
23. DB ARCHITECTURE
23
• Storage Manager :
• Since the storage space for corporate databases ranges in the size
from hundreds of gigabytes to terabytes of data, the main memory
cannot handle such large amount of data and hence disk can be
used.
24. DB ARCHITECTURE
24
• Functions
• It is the program module that provides the interface between the
low-level data stored in database and application programs and
queries submitted to the system.
• It translates the various DML statements into low-level system
commands.
• It is responsible for storing, retrieving and updating the data.
25. DB ARCHITECTURE
25
• Components
• Authorization and Integrity Manager : Performs the test for
ensuring Integrity constraint and authority of user.
• Transaction Manager : Ensures that database remains in a
consistent state despite system failure, and that concurrent
transaction execution proceed without conflicting.
• File Manager : It manages the allocation of space on the disk
storage and the data structures used to represent information
stored on the disk.
• Buffer Manager : It is responsible for fetching data from disk
storage into main memory and deciding what data to cache in
main memory. It enables the database to handle data sizes that are
larger than the size of main memory.
26. DB ARCHITECTURE
26
• Data Structures used by the Storage Manager
• Data Files : It store the database itself
• Data Dictionary : It stores the metadata about the structure of the
database, in particular the schema of the database. Metadata
means data about the data.
• Indices : It provide fast access to data items that hold particular
values.
27. DB ARCHITECTURE
27
• Query Processor :
• DDL Interpreter : It interprets DDL statement and records the definition in
data dictionary.
• DML Compiler : It translates the DML statement in query language into an
evaluation plan consisting of low-level instructions that the query evaluation
engine understands. It performs the query optimization for finding the lowest
cost evaluation plan.
• Query Evaluation Engine : It executes low-level instructions generated by
the DML compiler.
28. DB ARCHITECTURE
28
• DATABASE USERS :
• There are three types of database-system users, differentiated by
the way they expect to interact with the system.
• Naive Users : They are unsophisticated users who interact with
the system by invoking one of application programs that have been
written previously. These users interact with the system using
forms interface.
29. DB ARCHITECTURE
29
• Application Programmers : They are computer professionals
who write application programs. They can choose from many tools
to develop user interfaces.
• Sophisticated Users : They interact with the system without
writing programs. They form their requests in database query
language. As analyst, they use Online Analytical
Processing(OLAP) tool to analyze the statistical data and use
Data Mining tools for generating certain kinds of patterns in data.
30. DB ARCHITECTURE
30
• DATABASE ADMINISTRATOR (DBA)
• DBA is a person one who has central control of both the data and
programs that access those data.
• The functions of DBA include :
• Schema Definition
• Storage structures and access-method definition
• Schema and Physical organization modification
• Granting of authorization for data access
• Routine Maintenance Periodic backup,
• upgrading disk space as required.
• Monitoring
31. DATA MODELS
31
• A collection of conceptual tools for describing
• Data
• Data relationships
• Data semantics
• Data constraints
• Data model provides a way to describe the logical structure of database.
• Data models define how data is connected to each other and how they are
processed and stored inside the system.
32. DATA MODELS
32
• Types of data model :
• Relational model
• Entity-Relationship data model (mainly for database design)
• Object-based data models (Object-oriented and Object-relational)
• Semi-structured data model (XML)- Semi structured data model is a self describing
data model
• Other older models:
• Network model
• Hierarchical model
33. DATA MODELS
33
• The Relational Model
• It consists of collection of tables which stores data and represents
relationship among the data.
• Table is called as relation.
• Rows of table are called as tuples and columns of table are called as
field or attribute. The describing properties of table are called
attributes.
• The set of permitted values of attribute are called as domain.
35. DATA MODELS
35
• Advantages
– Structural independence
– Improved conceptual simplicity
– Easier database design, implementation, management, and use
– Ad hoc query capability
– Powerful database management system
• Disadvantages
– Substantial hardware and system software overhead
– Can facilitate poor design and implementation
– May promote “islands of information” problems
36. DATA MODELS
36
• The Entity Relationship Model(ER model)
• This model is popular for high level database design, mainly used to represent
entities and relationships exists between entities.
• Entity : a ‘thing’ or ‘object’ in the real world that is distinguishable from all
other objects. E.g. Each student in a college is an entity.
• Relationship : used to provide association between two or more entities
37. DATA MODELS
37
• This model represents overall logical structure of a database
• It is an aid for database design
• It is easy to visualize and understand
39. DATA MODELS
39
• Advantages
– Exceptional conceptual simplicity
– Visual representation
– Effective communication tool
– Integrated with the relational data model
• Disadvantages
– Limited constraint representation
– Limited relationship representation
– No data manipulation language
– Loss of information content
40. DATA MODELS
40
• Object-based data models (Object-oriented and Object-relational)
• Models both data and their relationships in a single structure
known as an object.
• Object: abstraction of a real-world entity
• Attributes describe the properties of an object
• Objects that share similar characteristics are grouped in classes.
• Includes information about relationships between facts within object and
relationships with other objects.
• Classes are organized in a class hierarchy
• Inheritance is the ability of an object within the class hierarchy to inherit
the attributes and methods of classes above it
41. DATA MODELS
41
• The object oriented data model extends the definition of an entity
to include, not only the attributes that describe the state of the
object but also the actions that are associated with the object, that
is, its behavior.
42. DATA MODELS
42
• Advantages
-Adds semantic content
-Reusability (inheritance, polymorphism)
-Support for schema evolution
-Improved performance
• Disadvantages
-Lack of universal data model
-Lack of experience
-Complex
43. DATA MODELS
43
• Semi-structured data model (XML) :
• Permits specification of data where individual data items of same
type may have different sets of attributes.
• The semi-structured model is a database model where there is
no separation between the data and the schema, and the amount
of structure used depends on the purpose.
44. DATA MODELS
44
• Advantages:
• It can represent the information of some data sources that cannot be
constrained by schema.
• It provides a flexible format for data exchange between different types of
databases.
• It can be helpful to view structured data as semi-structured (for browsing
purposes).
• The schema can easily be changed.
• The data transfer format may be portable.