DBMS Introduction
DBMS Introduction
DBMS Introduction
Prepared by S.S.KIRUTHIKA, AP/CSE SRM IST,RAMAPURAM Prepared by S.S.KIRUTHIKA, AP/CSE SRM IST,RAMAPURAM
Prepared by S.S.KIRUTHIKA, AP/CSE SRM IST,RAMAPURAM Prepared by S.S.KIRUTHIKA, AP/CSE SRM IST,RAMAPURAM
1
Advantages of DBMS over FPS Introduction to DBMS
7 8
Prepared by S.S.KIRUTHIKA, AP/CSE SRM IST,RAMAPURAM Prepared by S.S.KIRUTHIKA, AP/CSE SRM IST,RAMAPURAM
2
Purpose of Database System Purpose of Database System
13 14
Prepared by S.S.KIRUTHIKA, AP/CSE SRM IST,RAMAPURAM Prepared by S.S.KIRUTHIKA, AP/CSE SRM IST,RAMAPURAM
Prepared by S.S.KIRUTHIKA, AP/CSE SRM IST,RAMAPURAM Prepared by S.S.KIRUTHIKA, AP/CSE SRM IST,RAMAPURAM
Physical level The logical level thus describes the entire database in
The lowest level of abstraction describes how the data terms of a small number of relatively simple structures.
are actually stored. The physical level describes Although implementation of the simple structures at the
complex low-level data structures in detail logical level may involve complex physical-level
structures, the user of the logical level does not need to
Logical level be aware of this complexity.
The next-higher level of abstraction describes what This is referred to as physical data independence.
data are stored in the database, and what Database administrators, who must decide what
relationships exist among those data. information to keep in the database, use the logical
level of abstraction.
Prepared by S.S.KIRUTHIKA, AP/CSE SRM IST,RAMAPURAM Prepared by S.S.KIRUTHIKA, AP/CSE SRM IST,RAMAPURAM
3
Cont.. Database System Architecture
19 20
Prepared by S.S.KIRUTHIKA, AP/CSE SRM IST,RAMAPURAM Prepared by S.S.KIRUTHIKA, AP/CSE SRM IST,RAMAPURAM
Cont..
21
Centralized databases
One to a few cores, shared memory
Client-server
One server machine executes work on behalf of multiple client machines.
Parallel databases
Many core shared memory
Shared disk
Shared nothing
Distributed databases
Geographical distribution
Schema/data heterogeneity
Prepared by S.S.KIRUTHIKA, AP/CSE
Prepared by S.S.KIRUTHIKA, AP/CSE SRM IST,RAMAPURAM 22 SRM IST,RAMAPURAM
4
Query Processor Query Processing
25 26
Prepared by S.S.KIRUTHIKA, AP/CSE SRM IST,RAMAPURAM Prepared by S.S.KIRUTHIKA, AP/CSE SRM IST,RAMAPURAM
A transaction is a collection o f operations that Database applications are usually partitioned into
performs a single logical function in a database two or three parts
application Two-tier architecture
Transact ion-m anagement component ensures that Three- tier architecture
the dat abase 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 conc urrent transactions, to ensure the
consistency of the database.
Prepared by S.S.KIRUTHIKA, AP/CSE SRM IST,RAMAPURAM
Prepared by S.S.KIRUTHIKA, AP/CSE SRM IST,RAMAPURAM
Prepared by S.S.KIRUTHIKA, AP/CSE SRM IST,RAMAPURAM Prepared by S.S.KIRUTHIKA, AP/CSE SRM IST,RAMAPURAM
5
Three-Tier Architecture Data Independence
31 32
In a three-tier architecture, the client machine acts Data independence can be explained using the
as merely a front end and does not contain any three-schema architecture.
direct database calls. Data independence refers characteristic of being
Instead, the client end communicates with an able to modify the schema at one level of the
application server, usually through a forms database system without altering the schema at the
interface. next higher level.
The application server in turn communicates with a There are two types of data independence:
database system to access data. Physical data independence
Logical data independence
Prepared by S.S.KIRUTHIKA, AP/CSE SRM IST,RAMAPURAM Prepared by S.S.KIRUTHIKA, AP/CSE SRM IST,RAMAPURAM
Prepared by S.S.KIRUTHIKA, AP/CSE SRM IST,RAMAPURAM Prepared by S.S.KIRUTHIKA, AP/CSE SRM IST,RAMAPURAM
Logical data independence refers characteristic of Data Models are fundamental entities to introduce
being able to change the conceptual schema abstraction in a DBMS.
without having to change the external schema.
Data Model is a collection of tools for describing
Logical data independence is used to separate the
Data
external level from the conceptual view.
Data relationships
If we do any changes in the conceptual view of the Data semantics
data, then the user view of the data would not be Data constraints
affected.
Logical data independence occurs at the user
interface level.
Prepared by S.S.KIRUTHIKA, AP/CSE SRM IST,RAMAPURAM Prepared by S.S.KIRUTHIKA, AP/CSE SRM IST,RAMAPURAM
6
Data Abstraction Levels of Data Abstraction
37 38
Physical level The logical level thus describes the entire database in
The lowest level of abstraction describes how the data terms of a small number of relatively simple structures.
are actually stored. The physical level describes Although implementation of the simple structures at the
complex low-level data structures in detail logical level may involve complex physical-level
structures, the user of the logical level does not need to
Logical level be aware of this complexity.
The next-higher level of abstraction describes what This is referred to as physical data independence.
data are stored in the database, and what Database administrators, who must decide what
relationships exist among those data. information to keep in the database, use the logical
level of abstraction.
Prepared by S.S.KIRUTHIKA, AP/CSE SRM IST,RAMAPURAM Prepared by S.S.KIRUTHIKA, AP/CSE SRM IST,RAMAPURAM
7
Cont.. Relational Model
43 44
The data models can be classified into four different The relational model uses a collectio n of tables to
categories: represent both data and the relationships among
Relational model those data.
Entity-Relationship data model (mainly for database design)
Each table has multiple columns, and each column
Object-based data models (Object-oriented and Object-
relational)
has a unique name. Table s are also known as
relations.
Semi-structured data model (XML)
Other older models: The relational model is an example of a record-
Network model based model
Hierarchical model
Prepared by S.S.KIRUTHIKA, AP/CSE SRM IST,RAMAPURAM Prepared by S.S.KIRUTHIKA, AP/CSE SRM IST,RAMAPURAM
. The entity-relationship (E-R) data model uses a object-orie nted data model that can be seen as
collectio n of basic objects, calle d entities, and extending the E-R model with notions of
relationships among these objects. encapsulation, methods (functions), and object
An entity is a “thing” or “object” in the real world identity.
that is distinguishable from other objects. The obje ct-relational data model combines features
of the obje ct-oriented data model and relational
data model.
Prepared by S.S.KIRUTHIKA, AP/CSE SRM IST,RAMAPURAM Prepared by S.S.KIRUTHIKA, AP/CSE SRM IST,RAMAPURAM
The semi-structured data model permits the Network data model and the hierarchical data
specification of data where individual data items of model preceded the relational data model.
the same type may have different sets of attributes. These models were tied closely to the underlying
The Extensible Markup Language (XML) is widely implementatio n, and complicated the task of
used to represent semi-structured data. modeling data.
As a result they are used little now, except in old
database code that is still in service in some places.
Prepared by S.S.KIRUTHIKA, AP/CSE SRM IST,RAMAPURAM Prepared by S.S.KIRUTHIKA, AP/CSE SRM IST,RAMAPURAM
8
Evolution of Data Models Evolution of Data Models
49 50
1950s and early 1960s: 1980s:
Data processing using magnetic tapes for storage Research relational prototypes evolve into commercial systems
Would win the ACM Turing Award for this work Large multi-terabyte data warehouses
IBM Research begins System R prototype Emergence of Web commerce
Prepared by S.S.KIRUTHIKA, AP/CSE SRM IST,RAMAPURAM Prepared by S.S.KIRUTHIKA, AP/CSE SRM IST,RAMAPURAM
Database Users
Database Users
51
Prepared by S.S.KIRUTHIKA, AP/CSE SRM IST,RAMAPURAM 52 Prepared by S.S.KIRUTHIKA, AP/CSE SRM IST,RAMAPURAM
Cont.. Cont..
53 54
9
Role of DBA Database Languages
55 56
A person who has central control over the system is called a A DBMS has appropriate languages and interfaces
database administrator (DBA). Functions of a DBA include: to express database queries and updates.
Schema definition
Storage structure and access-method definition Database languages can be used to read, store
Schema and physical-organization modification and update the data in the database.
Granting of authorization for data access The types of database languages are:
Routine maintenance
DDL – Data Definition Language
Periodically backing up the database
Ensuring that enough free disk space is available for normal operations, DML – Data Manipulation Language
and upgrading disk space as required DCL – Data Control Language
Monitoring jobs running on the database
TCL – Transaction Control Language
Prepared by S.S.KIRUTHIKA, AP/CSE SRM IST,RAMAPURAM Prepared by S.S.KIRUTHIKA, AP/CSE SRM IST,RAMAPURAM
Data Definitio n Language is used to define Create: It is used to create objects in the database.
database structure or pattern. Alter: It is used to alter the structure of the
It is used to create schema, tables, indexes, database.
constraints, etc. in the database. Drop: It is used to dele te obje cts from the
Using the DDL statements, you can create the database.
skeleton of the database. Truncate: It is used to remove all records from a
Data definitio n language is used to store the table.
informatio n of metadata like the number of table s Rename: It is used to rename an object.
and schemas, their names, indexes, columns in each Comment: It is used to comment on the data
table, constraints, etc. dictionary.
Prepared by S.S.KIRUTHIKA, AP/CSE SRM IST,RAMAPURAM
Prepared by S.S.KIRUTHIKA, AP/CSE SRM IST,RAMAPURAM
It is used for accessing and manipulating data in a Data Control Language is used to retrie ve the
database. It handles user requests. stored or saved data.
The basic DML commands are: The DCL execution is transactional. It also has
Select: It is used to retrieve data from a database. rollback parameters.
Insert: It is used to insert data into a table. DCL commands are:
Update: It is used to update existing data within a Grant: It is used to give user access privileges to a
table. database.
Delete: It is used to delete all records from a table. Revoke: It is used to take back permis sio ns from the
user.
Prepared by S.S.KIRUTHIKA, AP/CSE SRM IST,RAMAPURAM Prepared by S.S.KIRUTHIKA, AP/CSE SRM IST,RAMAPURAM
10
Transaction Control Language(TCL)
61
11