0% found this document useful (0 votes)
6 views59 pages

DBMS Unit 1 Cont

This document covers fundamental concepts of database systems, including data models, schemas, and DBMS architecture. It explains the different levels of data abstraction, types of database languages, and interfaces, as well as the importance of data independence. Additionally, it discusses centralized and client-server architectures, along with the three-tier architecture for web applications.

Uploaded by

shreyassupe346
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views59 pages

DBMS Unit 1 Cont

This document covers fundamental concepts of database systems, including data models, schemas, and DBMS architecture. It explains the different levels of data abstraction, types of database languages, and interfaces, as well as the importance of data independence. Additionally, it discusses centralized and client-server architectures, along with the three-tier architecture for web applications.

Uploaded by

shreyassupe346
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 59

DATABASE SYSTEM CONCEPTS

AND ARCHITECTURE
At the end of this chapter you will be able to know
about:

 Data Models
 Schemas and Instances
 DBMS Architecture
 Data Independence
 Database Languages
 Database Interfaces
 Database System Environment
Data Models, Schemas and Instances

 Data Model : A Collection of concepts that can be used to describe the


structure of a database.

 Data Models provide necessary means to achieve data abstraction.

 Most data models also include a set of basic operations for specifying
retrievals / updates.
Categories of Data Models

Based on the type of concept they used to describe the database structure,
data models are categorized as follows :

 High level or conceptual Data Model

 Representational or Implementation Data Model

 Low level or Physical Data Model


High level or conceptual Data Model

 High level or conceptual data model provides a view close to the way
users perceive data.

 Conceptual level uses the concepts such as


➢ Entity : A real world thing
➢ Attribute : Characteristic or Properties of an entity
➢ Relationship : Dependency or association between two entities
Example

➢ Customer and Product are two entities. Customer number and name are
attributes of the Customer entity
➢ Product name and price are attributes of product entity
➢ Sale is the relationship between the customer and product

The focus is to represent data as a user will see it in the "real world."
Representational or Implementation Data Model

 Representational Data Model: It is between High level & Low


level data model which provides concepts that may be understood by end-
users.
 Representational data models represent data by using record structures and
hence called record - based data model.

 Three well-known data models of this type are


o Relational data models
o Network data models
o Hierarchical data models.
 The relational model represents data as relations, or tables.

The network model represents data as record types.


The Hierarchical model represents data as a hierarchical tree structures. Each
hierarchy represents a number of related records.
Low- Level or Physical Data Model

 They provide concepts that describe the details of how data is stored in
computer.

 Concepts provided by physical Data Model are only known by Computer


Specialists.

 Physical Data models describe how data is stored in files by representing


information such as record formats, record orderings and access paths.

 Access Path is a structure that makes the search for particular database
records efficient.
Schemas

 One must distinguish between the description of a database and the


database itself.

 The description of a database is called the database schema, which is


specified during database design and is not expected to change frequently.

 A displayed schema / diagrammatic representation of schema is called as


schema diagram.
Example of Schema diagram for UNIVERSITY database
 STUDENT
Name Student_number Class Major

 COURSE

Course_name Course_number Credit_hours Department

 SECTION

Section_identifier Course_number Semester Year Instructor


Database State

 The actual data stored in the database probably changes often. The data in
the database at a particular moment in time is called database state or
snapshot.
 It is called current et of occurrences or instances in the database.

 When we define a new database, we specify its database schema only to


the DBMS. At this point, the corresponding database state is the empty
state with no data.

 The schema is called the intension and the database state is called
extension of the schema
_______is a property that describes various characteristics of an entity

ER Diagram
Column
Relationship
Attribute
Which of the following is not a level of data abstraction?

Physical Level
Critical Level
Logical Level
View Level
Logical design of the database is called as __________

Database Instance
Database Snapshot
Database schema
All the above
Which of the following is the structure of the database?

Table
Schema
Relation
None of these
Course(course_id, semester)
Here course_id, semester are ______ and Course is a ________

Relations, Attribute
Attributes, Relation
Tuple, Relation
Tuple, Attributes
The concepts of data models that are only useful to computer specialists
rather than end users of programs are classified as

Triggered data models


Logical data models
conceptual data models
Physical data model
Database ____ which is the logical design of the database, and the
database _____ which is a snapshot of the data in the database at a
given instance in time.

 Instance, Schema
 Relation, Schema
 Relation, Domain
 Schema, Instance
The Three-Schema Architecture
 The goal of the 3 schema architecture is to separate the user applications
and the physical database.

 The schema architecture is defined at 3 levels :

➢ Internal Level / Internal Schema


➢ Conceptual level/Conceptual Schema
➢ External / View Level / External Schema
Internal Level / Internal Schema
 The internal level has internal schema, which describes the physical storage structure
of the database.
 The internal schema uses a physical data model and describes the complete details of
data storage and access paths for the database.

Conceptual level / Conceptual Schema

 Conceptual level describes the structure of the whole database for community of users.

 The conceptual schema hides the details of physical storage structures and concentrates on
describing entities, data types , relationships, user operations and constraints.

 Representational data model is used to describe the conceptual schema when a database is
implemented.
External Level / External Schema / View Level

 The external or view 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.

 Mappings among schema levels are needed to transform requests and data.
Programs refer to an external schema, and are mapped by the DBMS to the
internal schema for execution.

 The processes of transforming requests and results between levels are called
mappings.
Data Independence

The capacity to change the schema at one level of a database system without having
to change the schema at the next higher level is called as Data Independence.

We can define two types of Data Independence:

❑ Logical Data Independence.

❑ Physical Data Independence.


Data Independence

Logical Data Independence: The capacity to change the conceptual schema


without having to change the external schemas and their application
programs.

Physical Data Independence: The capacity to change the internal schema


without having to change the conceptual schema.
DBMS Languages

 A DBMS has appropriate languages and interfaces to express database queries and
updates.
 Database languages can be used to read, store and update the data in the database.

DDL - Data Definition Language


DML – Data Manipulation Language
DCL – Data Control Language
TCL – Transaction Control Language
VDL – View Definition Language
SDL - Storage Definition Language
DDL

It is used to define database structure or pattern.

It is used to create schema, tables, indexes, constraints, etc. in the database.

Using the DDL statements, you can create the skeleton of the database.

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.
Data Definition Language (DDL) Commands:

➢ Create: It is used to create objects in the database.

➢ Alter: It is used to alter the structure of the database.

➢ Drop: It is used to delete objects from the database.

➢ Truncate: It is used to remove all records from a table.

➢ Rename: It is used to rename an object.

➢ Comment: It is used to comment on the data dictionary.


DML
Data Manipulation Language is a language used to access or manipulate the data in
the database.
In simple words, this language is used to retrieve the data from the database, insert
new data into the database, and delete the existing data from the database .

Data Manipulation Language is mainly of two types:

❑ Procedural DML:
This type of DML describes what data is to be accessed and how to get that data.

❑ Declarative DML or Non-procedural DML:


This type of DML only describes what data is to be accessed without specifying
how to get it.
DML

Data Manipulation Language(DML) Commands:

➢ Select: It is used to retrieve data from a database.

➢ Insert: It is used to insert data into a table.

➢ Update: It is used to update existing data within a table.

➢ Delete: It is used to delete all records from a table.


DCL

DCL is used to access the stored or saved data. It is mainly used for revoking and
granting user access on a database. In the Oracle database, this language does not
have the feature of rollback. It is a part of SQL.

Data Control Language(DCL) Commands:

➢ Grant: This command allows user’s access privileges to the database.


➢ Revoke: This command removes the accessibility of users from the database
objects.
TCL

Transaction Control language is a language which manages transactions within the


database. It is used to execute the changes made by the data manipulation language
(DML) statements.

Transaction Control Language(TCL) Commands:

➢ Commit: This command is used to save the transactions in the database.

➢ Rollback: This command is used to restore the database to that state which was
last committed.
SDL

Storage Definition Language is used where no strict separation of levels is


maintained

SDL is used to specify internal schema

VDL

View Definition Language is used for specifying the external schemas (i.e
user views)
DBMS Languages
DBMS Interfaces

 Menu based interfaces for web clients or browsing

 Forms - based interfaces

 Graphical User Interfaces

 Natural Language Interfaces

 Speech Input and Output

 Interface for parametric users

 Interfaces for DBA


Menu based interfaces for web clients or browsing

 These interfaces present the user with list of options (called menus) that lead user
through the formulation of request.

 Menus do away with the need to memorize specific commands and syntax of a
query language.

 The query is composed step-by-step by picking options from a menu that is


displayed by the system.
Forms - based interfaces

 Displays a form to each user.


 Users can fill out all of the form entries to insert new data, or they can fill out only
certain entries, in which case the DBMS will retrieve matching data for the
remaining entries.

Graphical User Interfaces


 A GUI typically displays a schema to the user in diagrammatic form.

 The user then can specify a query by manipulating the 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.

 A natural language interface refers to the words in its schema, as well as to the set
of standard words in it dictionary, to interpret the request.

 If the interpretation is successful, the interface generates a high level query


corresponding to the natural language request and submits it to the DBMS for
processing; Otherwise a dialogue is started with the user to clarify the request.
Interface for Parametric Users
 Parametric users, such as bank tellers, often have a small set of operations that they
must perform repeatedly.

 For example, a teller is able to use single function keys to invoke routine and
repetitive transactions such as account deposits or withdrawals, or balance enquires.

Interfaces for the DBA

 Most database systems contain privileged command that can be used only by the
DBA staff.

 These include commands for creating accounts, setting system parameters, granting
account authorization, changing a schema, and reorganizing the storage structures of
a database.
Database System Environment- Component Modules of DBMS and
their interactions
About component modules

 The figure is divided into two halve. The top half of the diagram refers to the
various users of the database environment and their interfaces.
 The lower half demonstrates the internals of the DBMS responsible for storage of
data and processing of transaction.

Let us consider the top part of the figure:


➢ The DBA staff works on defining the database using DDL and other privileged
commands.
➢ The DDL compiler processes schema definitions, specified in the DDL and stores
the description in the DBMS catalog.
 Casual users and persons with occasional need for information from the database
interact using the interactive query interface.
 These queries are parsed and validated for correctness of the query syntax.
 The query compiler that compiles into an internal form. This internal query is
subjected to query optimization.
 Optimizer is does rearrangement and possible recording of operations and
elimination of redundancies.

 Application programmers write programs in host languages such as java, c, c++…


that are submitted to pre compiler.
 Pre compiler extracts the DML commands.
 These commands are sent to the DML compiler for compilation into object code for
database access.
 The rest of the program is sent to host compiler, executable code includes calls to the
runtime database processor.

In the lower part of figure the runtime database processor executes


 The privileged commands
 The executable query plans
 The canned transactions
 It works with system catalog and may update it with statistics.
 It also works with stored data manager, which in turn uses basic operating system
services for carrying out low level IO operations between disk and main memory.
Database System Utilities

Most DBMS’s have database utilities that help the DBA to manage the
database system.

Most common utilities have the following types of functions :

 Loading

 Backup

 Database Storage reorganization

 Performance monitoring
 Loading : A loading utility is used to load existing data files – such as text files or
sequential files – into the database.

 Backup : Creates the backup copy of the database, usually by dumping the entire
database onto tape or other mass storage medium.

 Database storage reorganization : This utility can be used to reorganize a set of


database files into different file organizations, and create new access paths to
improve performance.

 Performance Monitoring : Such a utility monitors database usage and provide


statistics to the DBA.
The DBA uses statistics in making decisions such as whether or not t reorganize the
files.
Centralized Architecture of DBMS

DBMS continued to operate as a centralized DBMS,


where all DBMS functionality, application program
execution, and UI processing were done on a single
computer.

The physical elements of a centralized architecture


Client/server DBMS designs emerged as DBMS
systems gradually began to take advantage of the
user side's computing capability.
Client Server Architecture of DBMS

 The client-server architecture refers to a system that hosts, delivers, and


manages most of the resources and services that the client requests.
 In this model, all requests and services are delivered over a network, and it
is also referred to as the networking computing model or client server
network.
Client Server Architecture of DBMS

 The client-server architecture refers to a system that hosts, delivers, and


manages most of the resources and services that the client requests.
 In this model, all requests and services are delivered over a network, and it
is also referred to as the networking computing model or client server
network.
Three-Tier and n-Tier Architectures for Web Applications

Many Web applications use an architecture called the


three-tier architecture, which adds an intermediate layer
between the client and the database server.

This intermediate layer or middle tier is called


the application server or the Web server, depending on
the application.

This server plays an intermediary role by running


application programs and storing business rules
(procedures or constraints) that are used to access data
from the database server.

It can also improve database security by checking a


client’s credentials before forwarding a request to the
data-base server.
Key Terms - For your knowledge.
centralized database system: the DBMS and database are stored at a single site that is used by
several other systems too

distributed database system: the actual database and the DBMS software are distributed from
various sites that are connected by a computer network

heterogeneous distributed database system: different sites might use different DBMS software,
but there is additional common software to support data exchange between these sites

homogeneous distributed database systems: use the same DBMS software at multiple sites

multiuser database system: a database management system which supports multiple users
concurrently

object-oriented data model: a database management system in which information is represented


in the form of objects as used in object-oriented programming

single-user database system: a database management system which supports one user at a time

You might also like