Unit1 Chap2 Notes Dbms
Unit1 Chap2 Notes Dbms
DATABASE SYSTEM
CONCEPTS AND
ARCHITECTURE
JYOTHY INSTITUTE OF COMMERCE & MANAGEMENT
#40/5, THATHAGUNI, OFF KANAKAPURA ROAD, BENGALURU – 560082
E-mail: [email protected] Website: www.jyothyicm.org
Data Model:
Data model can be defined as an integrated collection of concepts for describing and
manipulating data, relationships between data, and constraints on the data in an organization.
Manipulative part: defining the types of operation that are allowed on the data (This
includes the operations that are used for updating or retrieving data from the db and for
changing the structure of the db)
2. Representational/Implementation
/logical Data Model
Page 1
JYOTHY INSTITUTE OF COMMERCE & MANAGEMENT
#40/5, THATHAGUNI, OFF KANAKAPURA ROAD, BENGALURU – 560082
E-mail: [email protected] Website: www.jyothyicm.org
Hierarchical Model:
This is one of the oldest models in a data model which was developed by IBM, in the 1950s. In
this, the data is organized into a tree-like structure where each record consists of one parent
record and many children. The hierarchy begins at the root, which contains root data, and then
grows into a tree as child nodes are added to the
parent node.
Example
1. Parent-Child Relationship- A parent node exists for each child node. However, a parent node
might have several child nodes. It is not permitted to have more than one parent.
Page 2
JYOTHY INSTITUTE OF COMMERCE & MANAGEMENT
#40/5, THATHAGUNI, OFF KANAKAPURA ROAD, BENGALURU – 560082
E-mail: [email protected] Website: www.jyothyicm.org
2. One-to-many Relationship- The data is organised in a tree-like form, with the datatypes
having a one-to-many relationship. There can only be one path from any node to its parent.
Advantages:
1. Simplicity
2. Security
3. Database Integrity
4. Efficiency
Disadvantages:
1. Implementation Complexity
2. Db management problem: any changes made to the db structure, then we need to make
changes in the entire application program that access the database.
4. Operational Anomalies: This model suffers from the insert, delete and update anomalies
and also retrieval operation is difficult.
The hierarchical model is extended in the network model. To increase database performance
and standards, the network model was devised to express complicated data relationships more
effectively than hierarchical models. It has entities that are grouped in a graphical format, and
some of the entities can be reached by many paths.
Example
Page 3
JYOTHY INSTITUTE OF COMMERCE & MANAGEMENT
#40/5, THATHAGUNI, OFF KANAKAPURA ROAD, BENGALURU – 560082
E-mail: [email protected] Website: www.jyothyicm.org
1. Multiple Paths
There may be several paths to the same record due to the increased number of relationships. It
allows for quick and easy data access.
Data is more connected in this model since there are more relationships. This paradigm can
handle many-to-many as well as one-to-one relationships.
ADVANTAGES
DISADVANTAGES
1. System complexity
2. Operational Anomalies
3. Structural changes to the database are very difficult.
The relational model represents how data is stored in Relational Databases. A relational
database consists of a collection of tables, each of which
is assigned a unique name. In relational model, three key
terms are heavily used such as relations, attributes, and
domains. A relation nothing but is a table with rows and
columns. The named columns of the relation are called as
attributes, and finally the domain is nothing but the set
of values the attributes can take. The adjacent figure
gives us the overview of relational database model.
Page 4
JYOTHY INSTITUTE OF COMMERCE & MANAGEMENT
#40/5, THATHAGUNI, OFF KANAKAPURA ROAD, BENGALURU – 560082
E-mail: [email protected] Website: www.jyothyicm.org
Advantages
Disadvantages
In this model both data and the data relationships are stored into a single structure that’s known
as an object in the object-oriented data model (or OODM).
Advantages
Page 5
JYOTHY INSTITUTE OF COMMERCE & MANAGEMENT
#40/5, THATHAGUNI, OFF KANAKAPURA ROAD, BENGALURU – 560082
E-mail: [email protected] Website: www.jyothyicm.org
Easily understandable.
Cost of maintenance can reduced due to reusability
Disadvantages
Schema:
The overall design of the database is called database schema. Schema will not be changed
frequently. It is the logical structure of a database. It
does not show the data in the database.
Types of Schema
Physical schema − It is a database design at the physical level. It is hidden below the
logical schema and can be changed easily without affecting the application programs.
External − It is schema at view level. It is the highest level of a schema which defines
the views for end users.
Generally the Database Management System (DBMS) assists one physical schema, one logical
schema and several sub or external schemas.
Example
A database schema for a person will have fields for name, email, phone and address as shown
below –
Page 6
JYOTHY INSTITUTE OF COMMERCE & MANAGEMENT
#40/5, THATHAGUNI, OFF KANAKAPURA ROAD, BENGALURU – 560082
E-mail: [email protected] Website: www.jyothyicm.org
Instance
The Database instance or database state refers to the information stored in the database at a
given point of time. Thus, it is a dynamic value which keeps on changing.
Example
Schema Instance
Defines the basic structure of the database i.e. It is the set of Information stored at a
how the data will be stored in the database. particular time.
Conclusion
In short, the schema is the blueprint of the database, while the instance is the actual data
that is in the database. The schema is the database’s design, and the instance is the data it
contains.
Page 7
JYOTHY INSTITUTE OF COMMERCE & MANAGEMENT
#40/5, THATHAGUNI, OFF KANAKAPURA ROAD, BENGALURU – 560082
E-mail: [email protected] Website: www.jyothyicm.org
When you change the schema, you change the structure of the database. When you change the
instance, you change the data content.
Physical Level: This is the lowest level of database abstraction. In simple terms,
physical level of a database describes how the data is being stored in secondary storage
devices like disks and tapes and also gives insights on additional storage details. The
physical schema is also known as a Internal schema.
Conceptual Level: This level describes the structure of the whole database. It acts as a
middle layer between the physical storage and user view. It explains what data to be
stored in the database, what the data types are, and what relationship exists among those
data. There is only one conceptual schema per database. The conceptual schema
describes the design of a database at the conceptual level. Conceptual level is also known
as logical schema.
External Level: This is the highest level of database abstraction. It includes a number of
external schemas or user views. This level provides different views of the same database
for a specific user or a group of users. An external view provides a powerful and flexible
security mechanism by hiding the parts of the database from a particular user. An
external schema is also known as view schema.
Page 8
JYOTHY INSTITUTE OF COMMERCE & MANAGEMENT
#40/5, THATHAGUNI, OFF KANAKAPURA ROAD, BENGALURU – 560082
E-mail: [email protected] Website: www.jyothyicm.org
Mapping:
The three levels of DBMS architecture don't exist independently of each other. There must
be correspondence between the three levels. DBMS is responsible for correspondence
between the three types of schema. This correspondence is called Mapping.
The Conceptual/ Internal Mapping lies between the conceptual level and the internal level.
Its role is to define the correspondence between the records and fields of the conceptual
level and files and data structures of the internal level.
In simple words, the method of transforming a request from conceptual level and internal
level is called conceptual/Internal mapping.
The external/Conceptual Mapping lies between the external level and the Conceptual level.
Its role is to define the correspondence between a particular external and the conceptual
view.
In simple words, when a request is sent by the external user, the method of transforming the
request from external level to conceptual level is called External/Conceptual Mapping.
Data Independence
Data Independence is mainly defined as a property of DBMS that helps you to change the
database schema at one level of a system without changing the schema at the next level.
Page 9
JYOTHY INSTITUTE OF COMMERCE & MANAGEMENT
#40/5, THATHAGUNI, OFF KANAKAPURA ROAD, BENGALURU – 560082
E-mail: [email protected] Website: www.jyothyicm.org
o Using the DDL statements, you can create the skeleton of the
database.
o Data definition language is used to store the information of metadata like the number of
tables and schemas, their names, indexes, columns in each table, constraints, etc.
DML stands for Data Manipulation Language. It is used for accessing and manipulating data in
a database. It handles user requests.
o DCL stands for Data Control Language. It is used to retrieve the stored or saved data.
TCL is used to run the changes made by the DML statement. TCL can be grouped into a logical
transaction.
DBMS Interfaces:
Interfaces are the programs which convert system language to user understandable language
and user language to system understandable language.
Page 11
JYOTHY INSTITUTE OF COMMERCE & MANAGEMENT
#40/5, THATHAGUNI, OFF KANAKAPURA ROAD, BENGALURU – 560082
E-mail: [email protected] Website: www.jyothyicm.org
Graphical User Interfaces. A graphical interface (GUI) typically displays a schema to the user
in diagrammatic form. The user can then specify a query by manipulating the diagram. In many
cases, GUIs utilize both menus and forms. Most GUIs use a pointing device, such as a mouse,
to pick certain parts of the displayed schema diagram.
Natural Language Interfaces. These interfaces accept requests written in English or some
other language and attempt to "understand" them. A natural language interface usually has its
own "schema," which is similar to the database conceptual schema, as well as a dictionary of
important words. The natural language interface refers to the words in its schema, as well as to
the set of standard words in its dictionary, to interpret the request.
Interfaces for Parametric Users. Parametric users, such as bank tellers, often have a small set
of operations that they must perform repeatedly. Systems analysts and programmers design
implement a special interface for naive users. Usually, a small set of abbreviated commands is
included, with the goal of minimizing the number of keystrokes required for each request.
Interfaces for the DBA. Most database systems contain privileged commands that can be used
only by the DBA's staff. These include commands for creating accounts, setting system
parameters, granting account authorization, changing a schema, and reorganizing the storage
structures of a database.
Page 12
JYOTHY INSTITUTE OF COMMERCE & MANAGEMENT
#40/5, THATHAGUNI, OFF KANAKAPURA ROAD, BENGALURU – 560082
E-mail: [email protected] Website: www.jyothyicm.org
A DBMS is a complex software system. The database and the DBMS catalog are usually stored
on disk. Access to the disk is controlled primarily by the operating system (OS), which
schedules disk read/write.
Many DBMSs have their own buffer management module to schedule disk read/write,
because this has a considerable effect on performance. Reducing disk read/write improves
performance considerably. A higher-level stored data manager module of the DBMS controls
access to DBMS information that is stored on disk, whether it is part of the database or the
catalog.
The top part of Figure, It shows interfaces for the DBA staff, casual users who work with
interactive interfaces to formulate queries, application programmers who create programs using
some host programming languages, and parametric users who do data entry work by supplying
parameters to predefined transactions. The DBA staffs works on defining the database and
tuning it by making changes to its definition using the DDL and other privileged commands.
The DDL compiler processes schema definitions, specified in the DDL, and stores descriptions
of the schemas (meta-data) in the DBMS catalog. The catalog includes information such as the
names and sizes of files, names and data types of data items, storage details of each file,
mapping information among schemas, and constraints.
Casual users and persons with occasional need for information from the database interact using
some form of interface, which we call the interactive query interface. These queries are parsed
and validated for correctness of the query syntax, the names of files and a query compiler that
compiles them into an internal form. This internal query is subjected to query optimization; the
query optimizer is concerned with the rearrangement and possible reordering of operations,
elimination of redundancies, and use of correct algorithms and indexes during execution.
The precompiler extracts DML commands from an application program written in a host
programming language. These commands are sent to the DML compiler for compilation into
object code for database access. The rest of the program is sent to the host language compiler.
The object codes for the DML commands and the rest of the program are linked, forming a
canned transaction whose executable code includes calls to the runtime database processor.
It is now common to have the client program that accesses the DBMS running on a separate
computer from the computer on which the database resides. The former is called the client
Page 13
JYOTHY INSTITUTE OF COMMERCE & MANAGEMENT
#40/5, THATHAGUNI, OFF KANAKAPURA ROAD, BENGALURU – 560082
E-mail: [email protected] Website: www.jyothyicm.org
computer running DBMS client software and the latter is called the database server. In some
cases, the client accesses a middle computer, called the application server, which in turn
accesses the database server.
Architectures for DBMSs have followed trends similar to those for general computer system
architectures. Earlier architectures used mainframe computers to provide the main processing
for all system functions, including user application programs and user interface programs, as
well as all the DBMS functionality. The reason was that most users accessed such systems via
computer terminals that did not have processing power and only provided display capabilities.
Therefore, all processing was performed remotely on the computer system, and only display
information and controls were sent from the computer to the display terminals, which were
connected to the central computer via various types of communications networks.
Page 14
JYOTHY INSTITUTE OF COMMERCE & MANAGEMENT
#40/5, THATHAGUNI, OFF KANAKAPURA ROAD, BENGALURU – 560082
E-mail: [email protected] Website: www.jyothyicm.org
Database architecture essentially describes the location of all the pieces of information that
make up the database application. Database architecture is logically divided into two types.
Page 15
JYOTHY INSTITUTE OF COMMERCE & MANAGEMENT
#40/5, THATHAGUNI, OFF KANAKAPURA ROAD, BENGALURU – 560082
E-mail: [email protected] Website: www.jyothyicm.org
Three-tier Client / Server database architecture is commonly used architecture for web
applications.
Presentation Tier
Application Tier
Data Tier
Presentation Tier
Application Tier
It is the middle tier of the architecture also known as the logic tier as the information/request
gathered through the presentation tier is processed in detail here. It also interacts with the server
that stores the data. It processes the client’s request, formats, it and sends it back to the client. It
is also called as the intermediate layer.
Data Tier
It is the last tier of the architecture also known as the Database Tier. It is used to store the
processed information so that it can be retrieved later on when required. It consists of Database
Servers like Oracle, MySQL, DB2, etc. The communication between the Presentation Tier and
Data-Tier is done using middle-tier i.e. Application Tier.
Page 16
JYOTHY INSTITUTE OF COMMERCE & MANAGEMENT
#40/5, THATHAGUNI, OFF KANAKAPURA ROAD, BENGALURU – 560082
E-mail: [email protected] Website: www.jyothyicm.org
1. Centralized Database:
Advantages:
Disadvantages:
2. Distributed Database:
Advantages:
Page 17
JYOTHY INSTITUTE OF COMMERCE & MANAGEMENT
#40/5, THATHAGUNI, OFF KANAKAPURA ROAD, BENGALURU – 560082
E-mail: [email protected] Website: www.jyothyicm.org
Disadvantages:
Difficult to provide a uniform view to users since the database is at different physical
locations.
If the centralized system fails, entire system If one system fails, continues with the other
is halted. sites.
Access time is more in case of multiple Access time is less even in the case of
users. multiple users.
Classification of DBMS:
The DBMS can be classified into different categories on the basis of several criteria such as:
Page 18
JYOTHY INSTITUTE OF COMMERCE & MANAGEMENT
#40/5, THATHAGUNI, OFF KANAKAPURA ROAD, BENGALURU – 560082
E-mail: [email protected] Website: www.jyothyicm.org
Low-end systems
High-end systems.
General purpose
Specific purpose
*******************************************
Page 19